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 /* ISL_USE_EXCEPTIONS should be defined to 1 if exceptions are available.
22  * gcc and clang define __cpp_exceptions; MSVC and xlC define _CPPUNWIND.
23  * Older versions of gcc (e.g., 4.9) only define __EXCEPTIONS.
24  * If exceptions are not available, any error condition will result
25  * in an abort.
26  */
27 #ifndef ISL_USE_EXCEPTIONS
28 #if defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(__EXCEPTIONS)
29 #define ISL_USE_EXCEPTIONS	1
30 #else
31 #define ISL_USE_EXCEPTIONS	0
32 #endif
33 #endif
34 
35 namespace isl {
36 
37 class ctx {
38 	isl_ctx *ptr;
39 public:
ctx(isl_ctx * ctx)40 	/* implicit */ ctx(isl_ctx *ctx) : ptr(ctx) {}
release()41 	isl_ctx *release() {
42 		auto tmp = ptr;
43 		ptr = nullptr;
44 		return tmp;
45 	}
get()46 	isl_ctx *get() {
47 		return ptr;
48 	}
49 };
50 
51 /* Macros hiding try/catch.
52  * If exceptions are not available, then no exceptions will be thrown and
53  * there is nothing to catch.
54  */
55 #if ISL_USE_EXCEPTIONS
56 #define ISL_CPP_TRY		try
57 #define ISL_CPP_CATCH_ALL	catch (...)
58 #else
59 #define ISL_CPP_TRY		if (1)
60 #define ISL_CPP_CATCH_ALL	if (0)
61 #endif
62 
63 #if ISL_USE_EXCEPTIONS
64 
65 /* Class capturing isl errors.
66  *
67  * The what() return value is stored in a reference counted string
68  * to ensure that the copy constructor and the assignment operator
69  * do not throw any exceptions.
70  */
71 class exception : public std::exception {
72 	std::shared_ptr<std::string> what_str;
73 
74 protected:
75 	inline exception(const char *what_arg, const char *msg,
76 		const char *file, int line);
77 public:
exception()78 	exception() {}
exception(const char * what_arg)79 	exception(const char *what_arg) {
80 		what_str = std::make_shared<std::string>(what_arg);
81 	}
82 	static inline void throw_error(enum isl_error error, const char *msg,
83 		const char *file, int line);
what()84 	virtual const char *what() const noexcept {
85 		return what_str->c_str();
86 	}
87 
88 	/* Default behavior on error conditions that occur inside isl calls
89 	 * performed from inside the bindings.
90 	 * In the case exceptions are available, isl should continue
91 	 * without printing a warning since the warning message
92 	 * will be included in the exception thrown from inside the bindings.
93 	 */
94 	static constexpr auto on_error = ISL_ON_ERROR_CONTINUE;
95 	/* Wrapper for throwing an exception with the given message.
96 	 */
throw_invalid(const char * msg,const char * file,int line)97 	static void throw_invalid(const char *msg, const char *file, int line) {
98 		throw_error(isl_error_invalid, msg, file, line);
99 	}
100 	static inline void throw_last_error(ctx ctx);
101 };
102 
103 /* Create an exception of a type described by "what_arg", with
104  * error message "msg" in line "line" of file "file".
105  *
106  * Create a string holding the what() return value that
107  * corresponds to what isl would have printed.
108  * If no error message or no error file was set, then use "what_arg" instead.
109  */
exception(const char * what_arg,const char * msg,const char * file,int line)110 exception::exception(const char *what_arg, const char *msg, const char *file,
111 	int line)
112 {
113 	if (!msg || !file)
114 		what_str = std::make_shared<std::string>(what_arg);
115 	else
116 		what_str = std::make_shared<std::string>(std::string(file) +
117 				    ":" + std::to_string(line) + ": " + msg);
118 }
119 
120 class exception_abort : public exception {
121 	friend exception;
exception_abort(const char * msg,const char * file,int line)122 	exception_abort(const char *msg, const char *file, int line) :
123 		exception("execution aborted", msg, file, line) {}
124 };
125 
126 class exception_alloc : public exception {
127 	friend exception;
exception_alloc(const char * msg,const char * file,int line)128 	exception_alloc(const char *msg, const char *file, int line) :
129 		exception("memory allocation failure", msg, file, line) {}
130 };
131 
132 class exception_unknown : public exception {
133 	friend exception;
exception_unknown(const char * msg,const char * file,int line)134 	exception_unknown(const char *msg, const char *file, int line) :
135 		exception("unknown failure", msg, file, line) {}
136 };
137 
138 class exception_internal : public exception {
139 	friend exception;
exception_internal(const char * msg,const char * file,int line)140 	exception_internal(const char *msg, const char *file, int line) :
141 		exception("internal error", msg, file, line) {}
142 };
143 
144 class exception_invalid : public exception {
145 	friend exception;
exception_invalid(const char * msg,const char * file,int line)146 	exception_invalid(const char *msg, const char *file, int line) :
147 		exception("invalid argument", msg, file, line) {}
148 };
149 
150 class exception_quota : public exception {
151 	friend exception;
exception_quota(const char * msg,const char * file,int line)152 	exception_quota(const char *msg, const char *file, int line) :
153 		exception("quota exceeded", msg, file, line) {}
154 };
155 
156 class exception_unsupported : public exception {
157 	friend exception;
exception_unsupported(const char * msg,const char * file,int line)158 	exception_unsupported(const char *msg, const char *file, int line) :
159 		exception("unsupported operation", msg, file, line) {}
160 };
161 
162 /* Throw an exception of the class that corresponds to "error", with
163  * error message "msg" in line "line" of file "file".
164  *
165  * isl_error_none is treated as an invalid error type.
166  */
throw_error(enum isl_error error,const char * msg,const char * file,int line)167 void exception::throw_error(enum isl_error error, const char *msg,
168 	const char *file, int line)
169 {
170 	switch (error) {
171 	case isl_error_none:
172 		break;
173 	case isl_error_abort: throw exception_abort(msg, file, line);
174 	case isl_error_alloc: throw exception_alloc(msg, file, line);
175 	case isl_error_unknown: throw exception_unknown(msg, file, line);
176 	case isl_error_internal: throw exception_internal(msg, file, line);
177 	case isl_error_invalid: throw exception_invalid(msg, file, line);
178 	case isl_error_quota: throw exception_quota(msg, file, line);
179 	case isl_error_unsupported:
180 				throw exception_unsupported(msg, file, line);
181 	}
182 
183 	throw exception_invalid("invalid error type", file, line);
184 }
185 
186 /* Throw an exception corresponding to the last error on "ctx" and
187  * reset the error.
188  *
189  * If "ctx" is NULL or if it is not in an error state at the start,
190  * then an invalid argument exception is thrown.
191  */
throw_last_error(ctx ctx)192 void exception::throw_last_error(ctx ctx)
193 {
194 	enum isl_error error;
195 	const char *msg, *file;
196 	int line;
197 
198 	error = isl_ctx_last_error(ctx.get());
199 	msg = isl_ctx_last_error_msg(ctx.get());
200 	file = isl_ctx_last_error_file(ctx.get());
201 	line = isl_ctx_last_error_line(ctx.get());
202 	isl_ctx_reset_error(ctx.get());
203 
204 	throw_error(error, msg, file, line);
205 }
206 
207 #else
208 
209 #include <stdio.h>
210 #include <stdlib.h>
211 
212 class exception {
213 public:
214 	/* Default behavior on error conditions that occur inside isl calls
215 	 * performed from inside the bindings.
216 	 * In the case exceptions are not available, isl should abort.
217 	 */
218 	static constexpr auto on_error = ISL_ON_ERROR_ABORT;
219 	/* Wrapper for throwing an exception with the given message.
220 	 * In the case exceptions are not available, print an error and abort.
221 	 */
throw_invalid(const char * msg,const char * file,int line)222 	static void throw_invalid(const char *msg, const char *file, int line) {
223 		fprintf(stderr, "%s:%d: %s\n", file, line, msg);
224 		abort();
225 	}
226 	/* Throw an exception corresponding to the last
227 	 * error on "ctx".
228 	 * isl should already abort when an error condition occurs,
229 	 * so this function should never be called.
230 	 */
throw_last_error(ctx ctx)231 	static void throw_last_error(ctx ctx) {
232 		abort();
233 	}
234 };
235 
236 #endif
237 
238 /* Helper class for setting the on_error and resetting the option
239  * to the original value when leaving the scope.
240  */
241 class options_scoped_set_on_error {
242 	isl_ctx *ctx;
243 	int saved_on_error;
244 public:
options_scoped_set_on_error(class ctx ctx,int on_error)245 	options_scoped_set_on_error(class ctx ctx, int on_error) {
246 		this->ctx = ctx.get();
247 		saved_on_error = isl_options_get_on_error(this->ctx);
248 		isl_options_set_on_error(this->ctx, on_error);
249 	}
~options_scoped_set_on_error()250 	~options_scoped_set_on_error() {
251 		isl_options_set_on_error(ctx, saved_on_error);
252 	}
253 };
254 
255 } // namespace isl
256 
257 #include <isl/id.h>
258 #include <isl/space.h>
259 #include <isl/val.h>
260 #include <isl/aff.h>
261 #include <isl/set.h>
262 #include <isl/map.h>
263 #include <isl/ilp.h>
264 #include <isl/union_set.h>
265 #include <isl/union_map.h>
266 #include <isl/flow.h>
267 #include <isl/schedule.h>
268 #include <isl/schedule_node.h>
269 #include <isl/ast_build.h>
270 #include <isl/fixed_box.h>
271 
272 namespace isl {
273 
274 // forward declarations
275 class aff;
276 class aff_list;
277 class ast_build;
278 class ast_expr;
279 class ast_expr_id;
280 class ast_expr_int;
281 class ast_expr_op;
282 class ast_expr_op_access;
283 class ast_expr_op_add;
284 class ast_expr_op_address_of;
285 class ast_expr_op_and;
286 class ast_expr_op_and_then;
287 class ast_expr_op_call;
288 class ast_expr_op_cond;
289 class ast_expr_op_div;
290 class ast_expr_op_eq;
291 class ast_expr_op_fdiv_q;
292 class ast_expr_op_ge;
293 class ast_expr_op_gt;
294 class ast_expr_op_le;
295 class ast_expr_op_lt;
296 class ast_expr_op_max;
297 class ast_expr_op_member;
298 class ast_expr_op_min;
299 class ast_expr_op_minus;
300 class ast_expr_op_mul;
301 class ast_expr_op_or;
302 class ast_expr_op_or_else;
303 class ast_expr_op_pdiv_q;
304 class ast_expr_op_pdiv_r;
305 class ast_expr_op_select;
306 class ast_expr_op_sub;
307 class ast_expr_op_zdiv_r;
308 class ast_node;
309 class ast_node_block;
310 class ast_node_for;
311 class ast_node_if;
312 class ast_node_list;
313 class ast_node_mark;
314 class ast_node_user;
315 class basic_map;
316 class basic_set;
317 class fixed_box;
318 class id;
319 class id_list;
320 class map;
321 class map_list;
322 class multi_aff;
323 class multi_id;
324 class multi_pw_aff;
325 class multi_union_pw_aff;
326 class multi_val;
327 class point;
328 class pw_aff;
329 class pw_aff_list;
330 class pw_multi_aff;
331 class pw_multi_aff_list;
332 class schedule;
333 class schedule_constraints;
334 class schedule_node;
335 class schedule_node_band;
336 class schedule_node_context;
337 class schedule_node_domain;
338 class schedule_node_expansion;
339 class schedule_node_extension;
340 class schedule_node_filter;
341 class schedule_node_guard;
342 class schedule_node_leaf;
343 class schedule_node_mark;
344 class schedule_node_sequence;
345 class schedule_node_set;
346 class set;
347 class set_list;
348 class space;
349 class union_access_info;
350 class union_flow;
351 class union_map;
352 class union_pw_aff;
353 class union_pw_aff_list;
354 class union_pw_multi_aff;
355 class union_set;
356 class union_set_list;
357 class val;
358 class val_list;
359 
360 // declarations for isl::aff
361 inline aff manage(__isl_take isl_aff *ptr);
362 inline aff manage_copy(__isl_keep isl_aff *ptr);
363 
364 class aff {
365   friend inline aff manage(__isl_take isl_aff *ptr);
366   friend inline aff manage_copy(__isl_keep isl_aff *ptr);
367 
368 protected:
369   isl_aff *ptr = nullptr;
370 
371   inline explicit aff(__isl_take isl_aff *ptr);
372 
373 public:
374   inline /* implicit */ aff();
375   inline /* implicit */ aff(const aff &obj);
376   inline explicit aff(isl::ctx ctx, const std::string &str);
377   inline aff &operator=(aff obj);
378   inline ~aff();
379   inline __isl_give isl_aff *copy() const &;
380   inline __isl_give isl_aff *copy() && = delete;
381   inline __isl_keep isl_aff *get() const;
382   inline __isl_give isl_aff *release();
383   inline bool is_null() const;
384   inline isl::ctx ctx() const;
385 
386   inline isl::aff add(isl::aff aff2) const;
387   inline isl::multi_aff add(const isl::multi_aff &multi2) const;
388   inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
389   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
390   inline isl::pw_aff add(const isl::pw_aff &pwaff2) const;
391   inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
392   inline isl::union_pw_aff add(const isl::union_pw_aff &upa2) const;
393   inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
394   inline isl::aff add_constant(isl::val v) const;
395   inline isl::aff add_constant(long v) const;
396   inline isl::multi_aff add_constant(const isl::multi_val &mv) const;
397   inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
398   inline isl::aff as_aff() const;
399   inline isl::map as_map() const;
400   inline isl::multi_aff as_multi_aff() const;
401   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
402   inline isl::pw_multi_aff as_pw_multi_aff() const;
403   inline isl::set as_set() const;
404   inline isl::union_map as_union_map() const;
405   inline isl::aff at(int pos) const;
406   inline isl::basic_set bind(isl::id id) const;
407   inline isl::basic_set bind(const std::string &id) const;
408   inline isl::basic_set bind(const isl::multi_id &tuple) const;
409   inline isl::pw_aff bind_domain(const isl::multi_id &tuple) const;
410   inline isl::pw_aff bind_domain_wrapped_domain(const isl::multi_id &tuple) const;
411   inline isl::aff ceil() const;
412   inline isl::pw_aff coalesce() const;
413   inline isl::pw_aff cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const;
414   inline isl::multi_val constant_multi_val() const;
415   inline isl::val constant_val() const;
416   inline isl::val get_constant_val() const;
417   inline isl::aff div(isl::aff aff2) const;
418   inline isl::pw_aff div(const isl::pw_aff &pa2) const;
419   inline isl::set domain() const;
420   inline isl::set eq_set(isl::aff aff2) const;
421   inline isl::set eq_set(const isl::pw_aff &pwaff2) const;
422   inline isl::val eval(isl::point pnt) const;
423   inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
424   inline isl::multi_aff flat_range_product(const isl::multi_aff &multi2) const;
425   inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
426   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
427   inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
428   inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
429   inline isl::aff floor() const;
430   inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
431   inline isl::set ge_set(isl::aff aff2) const;
432   inline isl::set ge_set(const isl::pw_aff &pwaff2) const;
433   inline isl::aff gist(isl::set context) const;
434   inline isl::union_pw_aff gist(const isl::union_set &context) const;
435   inline isl::aff gist(const isl::basic_set &context) const;
436   inline isl::aff gist(const isl::point &context) const;
437   inline isl::set gt_set(isl::aff aff2) const;
438   inline isl::set gt_set(const isl::pw_aff &pwaff2) const;
439   inline bool has_range_tuple_id() const;
440   inline isl::multi_aff identity() const;
441   inline isl::pw_aff insert_domain(const isl::space &domain) const;
442   inline isl::pw_aff intersect_domain(const isl::set &set) const;
443   inline isl::union_pw_aff intersect_domain(const isl::space &space) const;
444   inline isl::union_pw_aff intersect_domain(const isl::union_set &uset) const;
445   inline isl::union_pw_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
446   inline isl::union_pw_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
447   inline isl::pw_aff intersect_params(const isl::set &set) const;
448   inline bool involves_locals() const;
449   inline bool involves_nan() const;
450   inline bool involves_param(const isl::id &id) const;
451   inline bool involves_param(const std::string &id) const;
452   inline bool involves_param(const isl::id_list &list) const;
453   inline bool is_cst() const;
454   inline bool isa_aff() const;
455   inline bool isa_multi_aff() const;
456   inline bool isa_pw_multi_aff() const;
457   inline isl::set le_set(isl::aff aff2) const;
458   inline isl::set le_set(const isl::pw_aff &pwaff2) const;
459   inline isl::aff_list list() const;
460   inline isl::set lt_set(isl::aff aff2) const;
461   inline isl::set lt_set(const isl::pw_aff &pwaff2) const;
462   inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
463   inline isl::pw_aff max(const isl::pw_aff &pwaff2) const;
464   inline isl::multi_val max_multi_val() const;
465   inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
466   inline isl::pw_aff min(const isl::pw_aff &pwaff2) const;
467   inline isl::multi_val min_multi_val() const;
468   inline isl::aff mod(isl::val mod) const;
469   inline isl::aff mod(long mod) const;
470   inline isl::aff mul(isl::aff aff2) const;
471   inline isl::pw_aff mul(const isl::pw_aff &pwaff2) const;
472   inline unsigned n_piece() const;
473   inline isl::set ne_set(isl::aff aff2) const;
474   inline isl::set ne_set(const isl::pw_aff &pwaff2) const;
475   inline isl::aff neg() const;
476   inline bool plain_is_empty() const;
477   inline bool plain_is_equal(const isl::multi_aff &multi2) const;
478   inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
479   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
480   inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
481   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
482   inline isl::multi_aff product(const isl::multi_aff &multi2) const;
483   inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
484   inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
485   inline isl::aff pullback(isl::multi_aff ma) const;
486   inline isl::pw_aff pullback(const isl::multi_pw_aff &mpa) const;
487   inline isl::pw_aff pullback(const isl::pw_multi_aff &pma) const;
488   inline isl::union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
489   inline isl::aff pullback(const isl::aff &ma) const;
490   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
491   inline isl::pw_multi_aff range_factor_domain() const;
492   inline isl::pw_multi_aff range_factor_range() const;
493   inline isl::multi_aff range_product(const isl::multi_aff &multi2) const;
494   inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
495   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
496   inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
497   inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
498   inline isl::id range_tuple_id() const;
499   inline isl::multi_aff reset_range_tuple_id() const;
500   inline isl::aff scale(isl::val v) const;
501   inline isl::aff scale(long v) const;
502   inline isl::multi_aff scale(const isl::multi_val &mv) const;
503   inline isl::aff scale_down(isl::val v) const;
504   inline isl::aff scale_down(long v) const;
505   inline isl::multi_aff scale_down(const isl::multi_val &mv) const;
506   inline isl::multi_aff set_at(int pos, const isl::aff &el) const;
507   inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
508   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
509   inline isl::multi_aff set_range_tuple(const isl::id &id) const;
510   inline isl::multi_aff set_range_tuple(const std::string &id) const;
511   inline unsigned size() const;
512   inline isl::space space() const;
513   inline isl::aff sub(isl::aff aff2) const;
514   inline isl::multi_aff sub(const isl::multi_aff &multi2) const;
515   inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
516   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
517   inline isl::pw_aff sub(const isl::pw_aff &pwaff2) const;
518   inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
519   inline isl::union_pw_aff sub(const isl::union_pw_aff &upa2) const;
520   inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
521   inline isl::pw_aff subtract_domain(const isl::set &set) const;
522   inline isl::union_pw_aff subtract_domain(const isl::space &space) const;
523   inline isl::union_pw_aff subtract_domain(const isl::union_set &uset) const;
524   inline isl::pw_aff tdiv_q(const isl::pw_aff &pa2) const;
525   inline isl::pw_aff tdiv_r(const isl::pw_aff &pa2) const;
526   inline isl::aff_list to_list() const;
527   inline isl::multi_pw_aff to_multi_pw_aff() const;
528   inline isl::multi_union_pw_aff to_multi_union_pw_aff() const;
529   inline isl::pw_multi_aff to_pw_multi_aff() const;
530   inline isl::union_pw_aff to_union_pw_aff() const;
531   inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
532   inline isl::aff unbind_params_insert_domain(isl::multi_id domain) const;
533   inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
534   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
535   inline isl::pw_aff union_add(const isl::pw_aff &pwaff2) const;
536   inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
537   inline isl::union_pw_aff union_add(const isl::union_pw_aff &upa2) const;
538   inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
539   static inline isl::aff zero_on_domain(isl::space space);
540 };
541 
542 // declarations for isl::aff_list
543 inline aff_list manage(__isl_take isl_aff_list *ptr);
544 inline aff_list manage_copy(__isl_keep isl_aff_list *ptr);
545 
546 class aff_list {
547   friend inline aff_list manage(__isl_take isl_aff_list *ptr);
548   friend inline aff_list manage_copy(__isl_keep isl_aff_list *ptr);
549 
550 protected:
551   isl_aff_list *ptr = nullptr;
552 
553   inline explicit aff_list(__isl_take isl_aff_list *ptr);
554 
555 public:
556   inline /* implicit */ aff_list();
557   inline /* implicit */ aff_list(const aff_list &obj);
558   inline explicit aff_list(isl::ctx ctx, int n);
559   inline explicit aff_list(isl::aff el);
560   inline explicit aff_list(isl::ctx ctx, const std::string &str);
561   inline aff_list &operator=(aff_list obj);
562   inline ~aff_list();
563   inline __isl_give isl_aff_list *copy() const &;
564   inline __isl_give isl_aff_list *copy() && = delete;
565   inline __isl_keep isl_aff_list *get() const;
566   inline __isl_give isl_aff_list *release();
567   inline bool is_null() const;
568   inline isl::ctx ctx() const;
569 
570   inline isl::aff_list add(isl::aff el) const;
571   inline isl::aff at(int index) const;
572   inline isl::aff get_at(int index) const;
573   inline isl::aff_list clear() const;
574   inline isl::aff_list concat(isl::aff_list list2) const;
575   inline isl::aff_list drop(unsigned int first, unsigned int n) const;
576   inline void foreach(const std::function<void(isl::aff)> &fn) const;
577   inline isl::aff_list insert(unsigned int pos, isl::aff el) const;
578   inline unsigned size() const;
579 };
580 
581 // declarations for isl::ast_build
582 inline ast_build manage(__isl_take isl_ast_build *ptr);
583 inline ast_build manage_copy(__isl_keep isl_ast_build *ptr);
584 
585 class ast_build {
586   friend inline ast_build manage(__isl_take isl_ast_build *ptr);
587   friend inline ast_build manage_copy(__isl_keep isl_ast_build *ptr);
588 
589 protected:
590   isl_ast_build *ptr = nullptr;
591 
592   inline explicit ast_build(__isl_take isl_ast_build *ptr);
593 
594 public:
595   inline /* implicit */ ast_build();
596   inline /* implicit */ ast_build(const ast_build &obj);
597   inline explicit ast_build(isl::ctx ctx);
598   inline ast_build &operator=(ast_build obj);
599   inline ~ast_build();
600   inline __isl_give isl_ast_build *copy() const &;
601   inline __isl_give isl_ast_build *copy() && = delete;
602   inline __isl_keep isl_ast_build *get() const;
603   inline __isl_give isl_ast_build *release();
604   inline bool is_null() const;
605   inline isl::ctx ctx() const;
606 
607 private:
608   inline ast_build &copy_callbacks(const ast_build &obj);
609   struct at_each_domain_data {
610     std::function<isl::ast_node(isl::ast_node, isl::ast_build)> func;
611     std::exception_ptr eptr;
612   };
613   std::shared_ptr<at_each_domain_data> at_each_domain_data;
614   static inline isl_ast_node *at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2);
615   inline void set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn);
616 public:
617   inline isl::ast_build set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const;
618   inline isl::ast_expr access_from(isl::multi_pw_aff mpa) const;
619   inline isl::ast_expr access_from(isl::pw_multi_aff pma) const;
620   inline isl::ast_expr call_from(isl::multi_pw_aff mpa) const;
621   inline isl::ast_expr call_from(isl::pw_multi_aff pma) const;
622   inline isl::ast_expr expr_from(isl::pw_aff pa) const;
623   inline isl::ast_expr expr_from(isl::set set) const;
624   static inline isl::ast_build from_context(isl::set set);
625   inline isl::ast_node node_from(isl::schedule schedule) const;
626   inline isl::ast_node node_from_schedule_map(isl::union_map schedule) const;
627   inline isl::union_map schedule() const;
628   inline isl::union_map get_schedule() const;
629 };
630 
631 // declarations for isl::ast_expr
632 inline ast_expr manage(__isl_take isl_ast_expr *ptr);
633 inline ast_expr manage_copy(__isl_keep isl_ast_expr *ptr);
634 
635 class ast_expr {
636   friend inline ast_expr manage(__isl_take isl_ast_expr *ptr);
637   friend inline ast_expr manage_copy(__isl_keep isl_ast_expr *ptr);
638 
639 protected:
640   isl_ast_expr *ptr = nullptr;
641 
642   inline explicit ast_expr(__isl_take isl_ast_expr *ptr);
643 
644 public:
645   inline /* implicit */ ast_expr();
646   inline /* implicit */ ast_expr(const ast_expr &obj);
647   inline ast_expr &operator=(ast_expr obj);
648   inline ~ast_expr();
649   inline __isl_give isl_ast_expr *copy() const &;
650   inline __isl_give isl_ast_expr *copy() && = delete;
651   inline __isl_keep isl_ast_expr *get() const;
652   inline __isl_give isl_ast_expr *release();
653   inline bool is_null() const;
654 private:
655   template <typename T,
656           typename = typename std::enable_if<std::is_same<
657                   const decltype(isl_ast_expr_get_type(NULL)),
658                   const T>::value>::type>
659   inline bool isa_type(T subtype) const;
660 public:
661   template <class T> inline bool isa() const;
662   template <class T> inline T as() const;
663   inline isl::ctx ctx() const;
664 
665   inline std::string to_C_str() const;
666 };
667 
668 // declarations for isl::ast_expr_id
669 
670 class ast_expr_id : public ast_expr {
671   template <class T>
672   friend bool ast_expr::isa() const;
673   friend ast_expr_id ast_expr::as<ast_expr_id>() const;
674   static const auto type = isl_ast_expr_id;
675 
676 protected:
677   inline explicit ast_expr_id(__isl_take isl_ast_expr *ptr);
678 
679 public:
680   inline /* implicit */ ast_expr_id();
681   inline /* implicit */ ast_expr_id(const ast_expr_id &obj);
682   inline ast_expr_id &operator=(ast_expr_id obj);
683   inline isl::ctx ctx() const;
684 
685   inline isl::id id() const;
686   inline isl::id get_id() const;
687 };
688 
689 // declarations for isl::ast_expr_int
690 
691 class ast_expr_int : public ast_expr {
692   template <class T>
693   friend bool ast_expr::isa() const;
694   friend ast_expr_int ast_expr::as<ast_expr_int>() const;
695   static const auto type = isl_ast_expr_int;
696 
697 protected:
698   inline explicit ast_expr_int(__isl_take isl_ast_expr *ptr);
699 
700 public:
701   inline /* implicit */ ast_expr_int();
702   inline /* implicit */ ast_expr_int(const ast_expr_int &obj);
703   inline ast_expr_int &operator=(ast_expr_int obj);
704   inline isl::ctx ctx() const;
705 
706   inline isl::val val() const;
707   inline isl::val get_val() const;
708 };
709 
710 // declarations for isl::ast_expr_op
711 
712 class ast_expr_op : public ast_expr {
713   template <class T>
714   friend bool ast_expr::isa() const;
715   friend ast_expr_op ast_expr::as<ast_expr_op>() const;
716   static const auto type = isl_ast_expr_op;
717 
718 protected:
719   inline explicit ast_expr_op(__isl_take isl_ast_expr *ptr);
720 
721 public:
722   inline /* implicit */ ast_expr_op();
723   inline /* implicit */ ast_expr_op(const ast_expr_op &obj);
724   inline ast_expr_op &operator=(ast_expr_op obj);
725 private:
726   template <typename T,
727           typename = typename std::enable_if<std::is_same<
728                   const decltype(isl_ast_expr_op_get_type(NULL)),
729                   const T>::value>::type>
730   inline bool isa_type(T subtype) const;
731 public:
732   template <class T> inline bool isa() const;
733   template <class T> inline T as() const;
734   inline isl::ctx ctx() const;
735 
736   inline isl::ast_expr arg(int pos) const;
737   inline isl::ast_expr get_arg(int pos) const;
738   inline unsigned n_arg() const;
739   inline unsigned get_n_arg() const;
740 };
741 
742 // declarations for isl::ast_expr_op_access
743 
744 class ast_expr_op_access : public ast_expr_op {
745   template <class T>
746   friend bool ast_expr_op::isa() const;
747   friend ast_expr_op_access ast_expr_op::as<ast_expr_op_access>() const;
748   static const auto type = isl_ast_expr_op_access;
749 
750 protected:
751   inline explicit ast_expr_op_access(__isl_take isl_ast_expr *ptr);
752 
753 public:
754   inline /* implicit */ ast_expr_op_access();
755   inline /* implicit */ ast_expr_op_access(const ast_expr_op_access &obj);
756   inline ast_expr_op_access &operator=(ast_expr_op_access obj);
757   inline isl::ctx ctx() const;
758 
759 };
760 
761 // declarations for isl::ast_expr_op_add
762 
763 class ast_expr_op_add : public ast_expr_op {
764   template <class T>
765   friend bool ast_expr_op::isa() const;
766   friend ast_expr_op_add ast_expr_op::as<ast_expr_op_add>() const;
767   static const auto type = isl_ast_expr_op_add;
768 
769 protected:
770   inline explicit ast_expr_op_add(__isl_take isl_ast_expr *ptr);
771 
772 public:
773   inline /* implicit */ ast_expr_op_add();
774   inline /* implicit */ ast_expr_op_add(const ast_expr_op_add &obj);
775   inline ast_expr_op_add &operator=(ast_expr_op_add obj);
776   inline isl::ctx ctx() const;
777 
778 };
779 
780 // declarations for isl::ast_expr_op_address_of
781 
782 class ast_expr_op_address_of : public ast_expr_op {
783   template <class T>
784   friend bool ast_expr_op::isa() const;
785   friend ast_expr_op_address_of ast_expr_op::as<ast_expr_op_address_of>() const;
786   static const auto type = isl_ast_expr_op_address_of;
787 
788 protected:
789   inline explicit ast_expr_op_address_of(__isl_take isl_ast_expr *ptr);
790 
791 public:
792   inline /* implicit */ ast_expr_op_address_of();
793   inline /* implicit */ ast_expr_op_address_of(const ast_expr_op_address_of &obj);
794   inline ast_expr_op_address_of &operator=(ast_expr_op_address_of obj);
795   inline isl::ctx ctx() const;
796 
797 };
798 
799 // declarations for isl::ast_expr_op_and
800 
801 class ast_expr_op_and : public ast_expr_op {
802   template <class T>
803   friend bool ast_expr_op::isa() const;
804   friend ast_expr_op_and ast_expr_op::as<ast_expr_op_and>() const;
805   static const auto type = isl_ast_expr_op_and;
806 
807 protected:
808   inline explicit ast_expr_op_and(__isl_take isl_ast_expr *ptr);
809 
810 public:
811   inline /* implicit */ ast_expr_op_and();
812   inline /* implicit */ ast_expr_op_and(const ast_expr_op_and &obj);
813   inline ast_expr_op_and &operator=(ast_expr_op_and obj);
814   inline isl::ctx ctx() const;
815 
816 };
817 
818 // declarations for isl::ast_expr_op_and_then
819 
820 class ast_expr_op_and_then : public ast_expr_op {
821   template <class T>
822   friend bool ast_expr_op::isa() const;
823   friend ast_expr_op_and_then ast_expr_op::as<ast_expr_op_and_then>() const;
824   static const auto type = isl_ast_expr_op_and_then;
825 
826 protected:
827   inline explicit ast_expr_op_and_then(__isl_take isl_ast_expr *ptr);
828 
829 public:
830   inline /* implicit */ ast_expr_op_and_then();
831   inline /* implicit */ ast_expr_op_and_then(const ast_expr_op_and_then &obj);
832   inline ast_expr_op_and_then &operator=(ast_expr_op_and_then obj);
833   inline isl::ctx ctx() const;
834 
835 };
836 
837 // declarations for isl::ast_expr_op_call
838 
839 class ast_expr_op_call : public ast_expr_op {
840   template <class T>
841   friend bool ast_expr_op::isa() const;
842   friend ast_expr_op_call ast_expr_op::as<ast_expr_op_call>() const;
843   static const auto type = isl_ast_expr_op_call;
844 
845 protected:
846   inline explicit ast_expr_op_call(__isl_take isl_ast_expr *ptr);
847 
848 public:
849   inline /* implicit */ ast_expr_op_call();
850   inline /* implicit */ ast_expr_op_call(const ast_expr_op_call &obj);
851   inline ast_expr_op_call &operator=(ast_expr_op_call obj);
852   inline isl::ctx ctx() const;
853 
854 };
855 
856 // declarations for isl::ast_expr_op_cond
857 
858 class ast_expr_op_cond : public ast_expr_op {
859   template <class T>
860   friend bool ast_expr_op::isa() const;
861   friend ast_expr_op_cond ast_expr_op::as<ast_expr_op_cond>() const;
862   static const auto type = isl_ast_expr_op_cond;
863 
864 protected:
865   inline explicit ast_expr_op_cond(__isl_take isl_ast_expr *ptr);
866 
867 public:
868   inline /* implicit */ ast_expr_op_cond();
869   inline /* implicit */ ast_expr_op_cond(const ast_expr_op_cond &obj);
870   inline ast_expr_op_cond &operator=(ast_expr_op_cond obj);
871   inline isl::ctx ctx() const;
872 
873 };
874 
875 // declarations for isl::ast_expr_op_div
876 
877 class ast_expr_op_div : public ast_expr_op {
878   template <class T>
879   friend bool ast_expr_op::isa() const;
880   friend ast_expr_op_div ast_expr_op::as<ast_expr_op_div>() const;
881   static const auto type = isl_ast_expr_op_div;
882 
883 protected:
884   inline explicit ast_expr_op_div(__isl_take isl_ast_expr *ptr);
885 
886 public:
887   inline /* implicit */ ast_expr_op_div();
888   inline /* implicit */ ast_expr_op_div(const ast_expr_op_div &obj);
889   inline ast_expr_op_div &operator=(ast_expr_op_div obj);
890   inline isl::ctx ctx() const;
891 
892 };
893 
894 // declarations for isl::ast_expr_op_eq
895 
896 class ast_expr_op_eq : public ast_expr_op {
897   template <class T>
898   friend bool ast_expr_op::isa() const;
899   friend ast_expr_op_eq ast_expr_op::as<ast_expr_op_eq>() const;
900   static const auto type = isl_ast_expr_op_eq;
901 
902 protected:
903   inline explicit ast_expr_op_eq(__isl_take isl_ast_expr *ptr);
904 
905 public:
906   inline /* implicit */ ast_expr_op_eq();
907   inline /* implicit */ ast_expr_op_eq(const ast_expr_op_eq &obj);
908   inline ast_expr_op_eq &operator=(ast_expr_op_eq obj);
909   inline isl::ctx ctx() const;
910 
911 };
912 
913 // declarations for isl::ast_expr_op_fdiv_q
914 
915 class ast_expr_op_fdiv_q : public ast_expr_op {
916   template <class T>
917   friend bool ast_expr_op::isa() const;
918   friend ast_expr_op_fdiv_q ast_expr_op::as<ast_expr_op_fdiv_q>() const;
919   static const auto type = isl_ast_expr_op_fdiv_q;
920 
921 protected:
922   inline explicit ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr);
923 
924 public:
925   inline /* implicit */ ast_expr_op_fdiv_q();
926   inline /* implicit */ ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj);
927   inline ast_expr_op_fdiv_q &operator=(ast_expr_op_fdiv_q obj);
928   inline isl::ctx ctx() const;
929 
930 };
931 
932 // declarations for isl::ast_expr_op_ge
933 
934 class ast_expr_op_ge : public ast_expr_op {
935   template <class T>
936   friend bool ast_expr_op::isa() const;
937   friend ast_expr_op_ge ast_expr_op::as<ast_expr_op_ge>() const;
938   static const auto type = isl_ast_expr_op_ge;
939 
940 protected:
941   inline explicit ast_expr_op_ge(__isl_take isl_ast_expr *ptr);
942 
943 public:
944   inline /* implicit */ ast_expr_op_ge();
945   inline /* implicit */ ast_expr_op_ge(const ast_expr_op_ge &obj);
946   inline ast_expr_op_ge &operator=(ast_expr_op_ge obj);
947   inline isl::ctx ctx() const;
948 
949 };
950 
951 // declarations for isl::ast_expr_op_gt
952 
953 class ast_expr_op_gt : public ast_expr_op {
954   template <class T>
955   friend bool ast_expr_op::isa() const;
956   friend ast_expr_op_gt ast_expr_op::as<ast_expr_op_gt>() const;
957   static const auto type = isl_ast_expr_op_gt;
958 
959 protected:
960   inline explicit ast_expr_op_gt(__isl_take isl_ast_expr *ptr);
961 
962 public:
963   inline /* implicit */ ast_expr_op_gt();
964   inline /* implicit */ ast_expr_op_gt(const ast_expr_op_gt &obj);
965   inline ast_expr_op_gt &operator=(ast_expr_op_gt obj);
966   inline isl::ctx ctx() const;
967 
968 };
969 
970 // declarations for isl::ast_expr_op_le
971 
972 class ast_expr_op_le : public ast_expr_op {
973   template <class T>
974   friend bool ast_expr_op::isa() const;
975   friend ast_expr_op_le ast_expr_op::as<ast_expr_op_le>() const;
976   static const auto type = isl_ast_expr_op_le;
977 
978 protected:
979   inline explicit ast_expr_op_le(__isl_take isl_ast_expr *ptr);
980 
981 public:
982   inline /* implicit */ ast_expr_op_le();
983   inline /* implicit */ ast_expr_op_le(const ast_expr_op_le &obj);
984   inline ast_expr_op_le &operator=(ast_expr_op_le obj);
985   inline isl::ctx ctx() const;
986 
987 };
988 
989 // declarations for isl::ast_expr_op_lt
990 
991 class ast_expr_op_lt : public ast_expr_op {
992   template <class T>
993   friend bool ast_expr_op::isa() const;
994   friend ast_expr_op_lt ast_expr_op::as<ast_expr_op_lt>() const;
995   static const auto type = isl_ast_expr_op_lt;
996 
997 protected:
998   inline explicit ast_expr_op_lt(__isl_take isl_ast_expr *ptr);
999 
1000 public:
1001   inline /* implicit */ ast_expr_op_lt();
1002   inline /* implicit */ ast_expr_op_lt(const ast_expr_op_lt &obj);
1003   inline ast_expr_op_lt &operator=(ast_expr_op_lt obj);
1004   inline isl::ctx ctx() const;
1005 
1006 };
1007 
1008 // declarations for isl::ast_expr_op_max
1009 
1010 class ast_expr_op_max : public ast_expr_op {
1011   template <class T>
1012   friend bool ast_expr_op::isa() const;
1013   friend ast_expr_op_max ast_expr_op::as<ast_expr_op_max>() const;
1014   static const auto type = isl_ast_expr_op_max;
1015 
1016 protected:
1017   inline explicit ast_expr_op_max(__isl_take isl_ast_expr *ptr);
1018 
1019 public:
1020   inline /* implicit */ ast_expr_op_max();
1021   inline /* implicit */ ast_expr_op_max(const ast_expr_op_max &obj);
1022   inline ast_expr_op_max &operator=(ast_expr_op_max obj);
1023   inline isl::ctx ctx() const;
1024 
1025 };
1026 
1027 // declarations for isl::ast_expr_op_member
1028 
1029 class ast_expr_op_member : public ast_expr_op {
1030   template <class T>
1031   friend bool ast_expr_op::isa() const;
1032   friend ast_expr_op_member ast_expr_op::as<ast_expr_op_member>() const;
1033   static const auto type = isl_ast_expr_op_member;
1034 
1035 protected:
1036   inline explicit ast_expr_op_member(__isl_take isl_ast_expr *ptr);
1037 
1038 public:
1039   inline /* implicit */ ast_expr_op_member();
1040   inline /* implicit */ ast_expr_op_member(const ast_expr_op_member &obj);
1041   inline ast_expr_op_member &operator=(ast_expr_op_member obj);
1042   inline isl::ctx ctx() const;
1043 
1044 };
1045 
1046 // declarations for isl::ast_expr_op_min
1047 
1048 class ast_expr_op_min : public ast_expr_op {
1049   template <class T>
1050   friend bool ast_expr_op::isa() const;
1051   friend ast_expr_op_min ast_expr_op::as<ast_expr_op_min>() const;
1052   static const auto type = isl_ast_expr_op_min;
1053 
1054 protected:
1055   inline explicit ast_expr_op_min(__isl_take isl_ast_expr *ptr);
1056 
1057 public:
1058   inline /* implicit */ ast_expr_op_min();
1059   inline /* implicit */ ast_expr_op_min(const ast_expr_op_min &obj);
1060   inline ast_expr_op_min &operator=(ast_expr_op_min obj);
1061   inline isl::ctx ctx() const;
1062 
1063 };
1064 
1065 // declarations for isl::ast_expr_op_minus
1066 
1067 class ast_expr_op_minus : public ast_expr_op {
1068   template <class T>
1069   friend bool ast_expr_op::isa() const;
1070   friend ast_expr_op_minus ast_expr_op::as<ast_expr_op_minus>() const;
1071   static const auto type = isl_ast_expr_op_minus;
1072 
1073 protected:
1074   inline explicit ast_expr_op_minus(__isl_take isl_ast_expr *ptr);
1075 
1076 public:
1077   inline /* implicit */ ast_expr_op_minus();
1078   inline /* implicit */ ast_expr_op_minus(const ast_expr_op_minus &obj);
1079   inline ast_expr_op_minus &operator=(ast_expr_op_minus obj);
1080   inline isl::ctx ctx() const;
1081 
1082 };
1083 
1084 // declarations for isl::ast_expr_op_mul
1085 
1086 class ast_expr_op_mul : public ast_expr_op {
1087   template <class T>
1088   friend bool ast_expr_op::isa() const;
1089   friend ast_expr_op_mul ast_expr_op::as<ast_expr_op_mul>() const;
1090   static const auto type = isl_ast_expr_op_mul;
1091 
1092 protected:
1093   inline explicit ast_expr_op_mul(__isl_take isl_ast_expr *ptr);
1094 
1095 public:
1096   inline /* implicit */ ast_expr_op_mul();
1097   inline /* implicit */ ast_expr_op_mul(const ast_expr_op_mul &obj);
1098   inline ast_expr_op_mul &operator=(ast_expr_op_mul obj);
1099   inline isl::ctx ctx() const;
1100 
1101 };
1102 
1103 // declarations for isl::ast_expr_op_or
1104 
1105 class ast_expr_op_or : public ast_expr_op {
1106   template <class T>
1107   friend bool ast_expr_op::isa() const;
1108   friend ast_expr_op_or ast_expr_op::as<ast_expr_op_or>() const;
1109   static const auto type = isl_ast_expr_op_or;
1110 
1111 protected:
1112   inline explicit ast_expr_op_or(__isl_take isl_ast_expr *ptr);
1113 
1114 public:
1115   inline /* implicit */ ast_expr_op_or();
1116   inline /* implicit */ ast_expr_op_or(const ast_expr_op_or &obj);
1117   inline ast_expr_op_or &operator=(ast_expr_op_or obj);
1118   inline isl::ctx ctx() const;
1119 
1120 };
1121 
1122 // declarations for isl::ast_expr_op_or_else
1123 
1124 class ast_expr_op_or_else : public ast_expr_op {
1125   template <class T>
1126   friend bool ast_expr_op::isa() const;
1127   friend ast_expr_op_or_else ast_expr_op::as<ast_expr_op_or_else>() const;
1128   static const auto type = isl_ast_expr_op_or_else;
1129 
1130 protected:
1131   inline explicit ast_expr_op_or_else(__isl_take isl_ast_expr *ptr);
1132 
1133 public:
1134   inline /* implicit */ ast_expr_op_or_else();
1135   inline /* implicit */ ast_expr_op_or_else(const ast_expr_op_or_else &obj);
1136   inline ast_expr_op_or_else &operator=(ast_expr_op_or_else obj);
1137   inline isl::ctx ctx() const;
1138 
1139 };
1140 
1141 // declarations for isl::ast_expr_op_pdiv_q
1142 
1143 class ast_expr_op_pdiv_q : public ast_expr_op {
1144   template <class T>
1145   friend bool ast_expr_op::isa() const;
1146   friend ast_expr_op_pdiv_q ast_expr_op::as<ast_expr_op_pdiv_q>() const;
1147   static const auto type = isl_ast_expr_op_pdiv_q;
1148 
1149 protected:
1150   inline explicit ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr);
1151 
1152 public:
1153   inline /* implicit */ ast_expr_op_pdiv_q();
1154   inline /* implicit */ ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj);
1155   inline ast_expr_op_pdiv_q &operator=(ast_expr_op_pdiv_q obj);
1156   inline isl::ctx ctx() const;
1157 
1158 };
1159 
1160 // declarations for isl::ast_expr_op_pdiv_r
1161 
1162 class ast_expr_op_pdiv_r : public ast_expr_op {
1163   template <class T>
1164   friend bool ast_expr_op::isa() const;
1165   friend ast_expr_op_pdiv_r ast_expr_op::as<ast_expr_op_pdiv_r>() const;
1166   static const auto type = isl_ast_expr_op_pdiv_r;
1167 
1168 protected:
1169   inline explicit ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr);
1170 
1171 public:
1172   inline /* implicit */ ast_expr_op_pdiv_r();
1173   inline /* implicit */ ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj);
1174   inline ast_expr_op_pdiv_r &operator=(ast_expr_op_pdiv_r obj);
1175   inline isl::ctx ctx() const;
1176 
1177 };
1178 
1179 // declarations for isl::ast_expr_op_select
1180 
1181 class ast_expr_op_select : public ast_expr_op {
1182   template <class T>
1183   friend bool ast_expr_op::isa() const;
1184   friend ast_expr_op_select ast_expr_op::as<ast_expr_op_select>() const;
1185   static const auto type = isl_ast_expr_op_select;
1186 
1187 protected:
1188   inline explicit ast_expr_op_select(__isl_take isl_ast_expr *ptr);
1189 
1190 public:
1191   inline /* implicit */ ast_expr_op_select();
1192   inline /* implicit */ ast_expr_op_select(const ast_expr_op_select &obj);
1193   inline ast_expr_op_select &operator=(ast_expr_op_select obj);
1194   inline isl::ctx ctx() const;
1195 
1196 };
1197 
1198 // declarations for isl::ast_expr_op_sub
1199 
1200 class ast_expr_op_sub : public ast_expr_op {
1201   template <class T>
1202   friend bool ast_expr_op::isa() const;
1203   friend ast_expr_op_sub ast_expr_op::as<ast_expr_op_sub>() const;
1204   static const auto type = isl_ast_expr_op_sub;
1205 
1206 protected:
1207   inline explicit ast_expr_op_sub(__isl_take isl_ast_expr *ptr);
1208 
1209 public:
1210   inline /* implicit */ ast_expr_op_sub();
1211   inline /* implicit */ ast_expr_op_sub(const ast_expr_op_sub &obj);
1212   inline ast_expr_op_sub &operator=(ast_expr_op_sub obj);
1213   inline isl::ctx ctx() const;
1214 
1215 };
1216 
1217 // declarations for isl::ast_expr_op_zdiv_r
1218 
1219 class ast_expr_op_zdiv_r : public ast_expr_op {
1220   template <class T>
1221   friend bool ast_expr_op::isa() const;
1222   friend ast_expr_op_zdiv_r ast_expr_op::as<ast_expr_op_zdiv_r>() const;
1223   static const auto type = isl_ast_expr_op_zdiv_r;
1224 
1225 protected:
1226   inline explicit ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr);
1227 
1228 public:
1229   inline /* implicit */ ast_expr_op_zdiv_r();
1230   inline /* implicit */ ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj);
1231   inline ast_expr_op_zdiv_r &operator=(ast_expr_op_zdiv_r obj);
1232   inline isl::ctx ctx() const;
1233 
1234 };
1235 
1236 // declarations for isl::ast_node
1237 inline ast_node manage(__isl_take isl_ast_node *ptr);
1238 inline ast_node manage_copy(__isl_keep isl_ast_node *ptr);
1239 
1240 class ast_node {
1241   friend inline ast_node manage(__isl_take isl_ast_node *ptr);
1242   friend inline ast_node manage_copy(__isl_keep isl_ast_node *ptr);
1243 
1244 protected:
1245   isl_ast_node *ptr = nullptr;
1246 
1247   inline explicit ast_node(__isl_take isl_ast_node *ptr);
1248 
1249 public:
1250   inline /* implicit */ ast_node();
1251   inline /* implicit */ ast_node(const ast_node &obj);
1252   inline ast_node &operator=(ast_node obj);
1253   inline ~ast_node();
1254   inline __isl_give isl_ast_node *copy() const &;
1255   inline __isl_give isl_ast_node *copy() && = delete;
1256   inline __isl_keep isl_ast_node *get() const;
1257   inline __isl_give isl_ast_node *release();
1258   inline bool is_null() const;
1259 private:
1260   template <typename T,
1261           typename = typename std::enable_if<std::is_same<
1262                   const decltype(isl_ast_node_get_type(NULL)),
1263                   const T>::value>::type>
1264   inline bool isa_type(T subtype) const;
1265 public:
1266   template <class T> inline bool isa() const;
1267   template <class T> inline T as() const;
1268   inline isl::ctx ctx() const;
1269 
1270   inline std::string to_C_str() const;
1271   inline isl::ast_node_list to_list() const;
1272 };
1273 
1274 // declarations for isl::ast_node_block
1275 
1276 class ast_node_block : public ast_node {
1277   template <class T>
1278   friend bool ast_node::isa() const;
1279   friend ast_node_block ast_node::as<ast_node_block>() const;
1280   static const auto type = isl_ast_node_block;
1281 
1282 protected:
1283   inline explicit ast_node_block(__isl_take isl_ast_node *ptr);
1284 
1285 public:
1286   inline /* implicit */ ast_node_block();
1287   inline /* implicit */ ast_node_block(const ast_node_block &obj);
1288   inline ast_node_block &operator=(ast_node_block obj);
1289   inline isl::ctx ctx() const;
1290 
1291   inline isl::ast_node_list children() const;
1292   inline isl::ast_node_list get_children() const;
1293 };
1294 
1295 // declarations for isl::ast_node_for
1296 
1297 class ast_node_for : public ast_node {
1298   template <class T>
1299   friend bool ast_node::isa() const;
1300   friend ast_node_for ast_node::as<ast_node_for>() const;
1301   static const auto type = isl_ast_node_for;
1302 
1303 protected:
1304   inline explicit ast_node_for(__isl_take isl_ast_node *ptr);
1305 
1306 public:
1307   inline /* implicit */ ast_node_for();
1308   inline /* implicit */ ast_node_for(const ast_node_for &obj);
1309   inline ast_node_for &operator=(ast_node_for obj);
1310   inline isl::ctx ctx() const;
1311 
1312   inline isl::ast_node body() const;
1313   inline isl::ast_node get_body() const;
1314   inline isl::ast_expr cond() const;
1315   inline isl::ast_expr get_cond() const;
1316   inline isl::ast_expr inc() const;
1317   inline isl::ast_expr get_inc() const;
1318   inline isl::ast_expr init() const;
1319   inline isl::ast_expr get_init() const;
1320   inline bool is_degenerate() const;
1321   inline isl::ast_expr iterator() const;
1322   inline isl::ast_expr get_iterator() const;
1323 };
1324 
1325 // declarations for isl::ast_node_if
1326 
1327 class ast_node_if : public ast_node {
1328   template <class T>
1329   friend bool ast_node::isa() const;
1330   friend ast_node_if ast_node::as<ast_node_if>() const;
1331   static const auto type = isl_ast_node_if;
1332 
1333 protected:
1334   inline explicit ast_node_if(__isl_take isl_ast_node *ptr);
1335 
1336 public:
1337   inline /* implicit */ ast_node_if();
1338   inline /* implicit */ ast_node_if(const ast_node_if &obj);
1339   inline ast_node_if &operator=(ast_node_if obj);
1340   inline isl::ctx ctx() const;
1341 
1342   inline isl::ast_expr cond() const;
1343   inline isl::ast_expr get_cond() const;
1344   inline isl::ast_node else_node() const;
1345   inline isl::ast_node get_else_node() const;
1346   inline bool has_else_node() const;
1347   inline isl::ast_node then_node() const;
1348   inline isl::ast_node get_then_node() const;
1349 };
1350 
1351 // declarations for isl::ast_node_list
1352 inline ast_node_list manage(__isl_take isl_ast_node_list *ptr);
1353 inline ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr);
1354 
1355 class ast_node_list {
1356   friend inline ast_node_list manage(__isl_take isl_ast_node_list *ptr);
1357   friend inline ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr);
1358 
1359 protected:
1360   isl_ast_node_list *ptr = nullptr;
1361 
1362   inline explicit ast_node_list(__isl_take isl_ast_node_list *ptr);
1363 
1364 public:
1365   inline /* implicit */ ast_node_list();
1366   inline /* implicit */ ast_node_list(const ast_node_list &obj);
1367   inline explicit ast_node_list(isl::ctx ctx, int n);
1368   inline explicit ast_node_list(isl::ast_node el);
1369   inline ast_node_list &operator=(ast_node_list obj);
1370   inline ~ast_node_list();
1371   inline __isl_give isl_ast_node_list *copy() const &;
1372   inline __isl_give isl_ast_node_list *copy() && = delete;
1373   inline __isl_keep isl_ast_node_list *get() const;
1374   inline __isl_give isl_ast_node_list *release();
1375   inline bool is_null() const;
1376   inline isl::ctx ctx() const;
1377 
1378   inline isl::ast_node_list add(isl::ast_node el) const;
1379   inline isl::ast_node at(int index) const;
1380   inline isl::ast_node get_at(int index) const;
1381   inline isl::ast_node_list clear() const;
1382   inline isl::ast_node_list concat(isl::ast_node_list list2) const;
1383   inline isl::ast_node_list drop(unsigned int first, unsigned int n) const;
1384   inline void foreach(const std::function<void(isl::ast_node)> &fn) const;
1385   inline isl::ast_node_list insert(unsigned int pos, isl::ast_node el) const;
1386   inline unsigned size() const;
1387 };
1388 
1389 // declarations for isl::ast_node_mark
1390 
1391 class ast_node_mark : public ast_node {
1392   template <class T>
1393   friend bool ast_node::isa() const;
1394   friend ast_node_mark ast_node::as<ast_node_mark>() const;
1395   static const auto type = isl_ast_node_mark;
1396 
1397 protected:
1398   inline explicit ast_node_mark(__isl_take isl_ast_node *ptr);
1399 
1400 public:
1401   inline /* implicit */ ast_node_mark();
1402   inline /* implicit */ ast_node_mark(const ast_node_mark &obj);
1403   inline ast_node_mark &operator=(ast_node_mark obj);
1404   inline isl::ctx ctx() const;
1405 
1406   inline isl::id id() const;
1407   inline isl::id get_id() const;
1408   inline isl::ast_node node() const;
1409   inline isl::ast_node get_node() const;
1410 };
1411 
1412 // declarations for isl::ast_node_user
1413 
1414 class ast_node_user : public ast_node {
1415   template <class T>
1416   friend bool ast_node::isa() const;
1417   friend ast_node_user ast_node::as<ast_node_user>() const;
1418   static const auto type = isl_ast_node_user;
1419 
1420 protected:
1421   inline explicit ast_node_user(__isl_take isl_ast_node *ptr);
1422 
1423 public:
1424   inline /* implicit */ ast_node_user();
1425   inline /* implicit */ ast_node_user(const ast_node_user &obj);
1426   inline ast_node_user &operator=(ast_node_user obj);
1427   inline isl::ctx ctx() const;
1428 
1429   inline isl::ast_expr expr() const;
1430   inline isl::ast_expr get_expr() const;
1431 };
1432 
1433 // declarations for isl::basic_map
1434 inline basic_map manage(__isl_take isl_basic_map *ptr);
1435 inline basic_map manage_copy(__isl_keep isl_basic_map *ptr);
1436 
1437 class basic_map {
1438   friend inline basic_map manage(__isl_take isl_basic_map *ptr);
1439   friend inline basic_map manage_copy(__isl_keep isl_basic_map *ptr);
1440 
1441 protected:
1442   isl_basic_map *ptr = nullptr;
1443 
1444   inline explicit basic_map(__isl_take isl_basic_map *ptr);
1445 
1446 public:
1447   inline /* implicit */ basic_map();
1448   inline /* implicit */ basic_map(const basic_map &obj);
1449   inline explicit basic_map(isl::ctx ctx, const std::string &str);
1450   inline basic_map &operator=(basic_map obj);
1451   inline ~basic_map();
1452   inline __isl_give isl_basic_map *copy() const &;
1453   inline __isl_give isl_basic_map *copy() && = delete;
1454   inline __isl_keep isl_basic_map *get() const;
1455   inline __isl_give isl_basic_map *release();
1456   inline bool is_null() const;
1457   inline isl::ctx ctx() const;
1458 
1459   inline isl::basic_map affine_hull() const;
1460   inline isl::basic_map apply_domain(isl::basic_map bmap2) const;
1461   inline isl::map apply_domain(const isl::map &map2) const;
1462   inline isl::union_map apply_domain(const isl::union_map &umap2) const;
1463   inline isl::basic_map apply_range(isl::basic_map bmap2) const;
1464   inline isl::map apply_range(const isl::map &map2) const;
1465   inline isl::union_map apply_range(const isl::union_map &umap2) const;
1466   inline isl::map as_map() const;
1467   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
1468   inline isl::pw_multi_aff as_pw_multi_aff() const;
1469   inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
1470   inline isl::set bind_domain(const isl::multi_id &tuple) const;
1471   inline isl::set bind_range(const isl::multi_id &tuple) const;
1472   inline isl::map coalesce() const;
1473   inline isl::map complement() const;
1474   inline isl::union_map compute_divs() const;
1475   inline isl::map curry() const;
1476   inline isl::basic_set deltas() const;
1477   inline isl::basic_map detect_equalities() const;
1478   inline isl::set domain() const;
1479   inline isl::map domain_factor_domain() const;
1480   inline isl::map domain_factor_range() const;
1481   inline isl::union_map domain_map() const;
1482   inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
1483   inline isl::map domain_product(const isl::map &map2) const;
1484   inline isl::union_map domain_product(const isl::union_map &umap2) const;
1485   inline unsigned domain_tuple_dim() const;
1486   inline isl::id domain_tuple_id() const;
1487   inline isl::map eq_at(const isl::multi_pw_aff &mpa) const;
1488   inline isl::union_map eq_at(const isl::multi_union_pw_aff &mupa) const;
1489   inline bool every_map(const std::function<bool(isl::map)> &test) const;
1490   inline isl::map extract_map(const isl::space &space) const;
1491   inline isl::map factor_domain() const;
1492   inline isl::map factor_range() const;
1493   inline isl::union_map fixed_power(const isl::val &exp) const;
1494   inline isl::union_map fixed_power(long exp) const;
1495   inline isl::basic_map flatten() const;
1496   inline isl::basic_map flatten_domain() const;
1497   inline isl::basic_map flatten_range() const;
1498   inline void foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const;
1499   inline void foreach_map(const std::function<void(isl::map)> &fn) const;
1500   inline isl::basic_map gist(isl::basic_map context) const;
1501   inline isl::map gist(const isl::map &context) const;
1502   inline isl::union_map gist(const isl::union_map &context) const;
1503   inline isl::map gist_domain(const isl::set &context) const;
1504   inline isl::union_map gist_domain(const isl::union_set &uset) const;
1505   inline isl::union_map gist_params(const isl::set &set) const;
1506   inline isl::union_map gist_range(const isl::union_set &uset) const;
1507   inline bool has_domain_tuple_id() const;
1508   inline bool has_range_tuple_id() const;
1509   inline isl::basic_map intersect(isl::basic_map bmap2) const;
1510   inline isl::map intersect(const isl::map &map2) const;
1511   inline isl::union_map intersect(const isl::union_map &umap2) const;
1512   inline isl::basic_map intersect_domain(isl::basic_set bset) const;
1513   inline isl::map intersect_domain(const isl::set &set) const;
1514   inline isl::union_map intersect_domain(const isl::space &space) const;
1515   inline isl::union_map intersect_domain(const isl::union_set &uset) const;
1516   inline isl::basic_map intersect_domain(const isl::point &bset) const;
1517   inline isl::map intersect_domain_factor_domain(const isl::map &factor) const;
1518   inline isl::union_map intersect_domain_factor_domain(const isl::union_map &factor) const;
1519   inline isl::map intersect_domain_factor_range(const isl::map &factor) const;
1520   inline isl::union_map intersect_domain_factor_range(const isl::union_map &factor) const;
1521   inline isl::map intersect_params(const isl::set &params) const;
1522   inline isl::basic_map intersect_range(isl::basic_set bset) const;
1523   inline isl::map intersect_range(const isl::set &set) const;
1524   inline isl::union_map intersect_range(const isl::space &space) const;
1525   inline isl::union_map intersect_range(const isl::union_set &uset) const;
1526   inline isl::basic_map intersect_range(const isl::point &bset) const;
1527   inline isl::map intersect_range_factor_domain(const isl::map &factor) const;
1528   inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
1529   inline isl::map intersect_range_factor_range(const isl::map &factor) const;
1530   inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
1531   inline bool is_bijective() const;
1532   inline bool is_disjoint(const isl::map &map2) const;
1533   inline bool is_disjoint(const isl::union_map &umap2) const;
1534   inline bool is_empty() const;
1535   inline bool is_equal(const isl::basic_map &bmap2) const;
1536   inline bool is_equal(const isl::map &map2) const;
1537   inline bool is_equal(const isl::union_map &umap2) const;
1538   inline bool is_injective() const;
1539   inline bool is_single_valued() const;
1540   inline bool is_strict_subset(const isl::map &map2) const;
1541   inline bool is_strict_subset(const isl::union_map &umap2) const;
1542   inline bool is_subset(const isl::basic_map &bmap2) const;
1543   inline bool is_subset(const isl::map &map2) const;
1544   inline bool is_subset(const isl::union_map &umap2) const;
1545   inline bool isa_map() const;
1546   inline isl::map lex_ge_at(const isl::multi_pw_aff &mpa) const;
1547   inline isl::map lex_gt_at(const isl::multi_pw_aff &mpa) const;
1548   inline isl::map lex_le_at(const isl::multi_pw_aff &mpa) const;
1549   inline isl::map lex_lt_at(const isl::multi_pw_aff &mpa) const;
1550   inline isl::map lexmax() const;
1551   inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1552   inline isl::map lexmin() const;
1553   inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1554   inline isl::map lower_bound(const isl::multi_pw_aff &lower) const;
1555   inline isl::map_list map_list() const;
1556   inline isl::multi_pw_aff max_multi_pw_aff() const;
1557   inline isl::multi_pw_aff min_multi_pw_aff() const;
1558   inline unsigned n_basic_map() const;
1559   inline isl::basic_map polyhedral_hull() const;
1560   inline isl::map preimage_domain(const isl::multi_aff &ma) const;
1561   inline isl::map preimage_domain(const isl::multi_pw_aff &mpa) const;
1562   inline isl::map preimage_domain(const isl::pw_multi_aff &pma) const;
1563   inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
1564   inline isl::map preimage_range(const isl::multi_aff &ma) const;
1565   inline isl::map preimage_range(const isl::pw_multi_aff &pma) const;
1566   inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
1567   inline isl::map product(const isl::map &map2) const;
1568   inline isl::union_map product(const isl::union_map &umap2) const;
1569   inline isl::map project_out_all_params() const;
1570   inline isl::set range() const;
1571   inline isl::map range_factor_domain() const;
1572   inline isl::map range_factor_range() const;
1573   inline isl::fixed_box range_lattice_tile() const;
1574   inline isl::union_map range_map() const;
1575   inline isl::map range_product(const isl::map &map2) const;
1576   inline isl::union_map range_product(const isl::union_map &umap2) const;
1577   inline isl::map range_reverse() const;
1578   inline isl::fixed_box range_simple_fixed_box_hull() const;
1579   inline unsigned range_tuple_dim() const;
1580   inline isl::id range_tuple_id() const;
1581   inline isl::basic_map reverse() const;
1582   inline isl::basic_map sample() const;
1583   inline isl::map set_domain_tuple(const isl::id &id) const;
1584   inline isl::map set_domain_tuple(const std::string &id) const;
1585   inline isl::map set_range_tuple(const isl::id &id) const;
1586   inline isl::map set_range_tuple(const std::string &id) const;
1587   inline isl::space space() const;
1588   inline isl::map subtract(const isl::map &map2) const;
1589   inline isl::union_map subtract(const isl::union_map &umap2) const;
1590   inline isl::union_map subtract_domain(const isl::union_set &dom) const;
1591   inline isl::union_map subtract_range(const isl::union_set &dom) const;
1592   inline isl::map_list to_list() const;
1593   inline isl::union_map to_union_map() const;
1594   inline isl::map uncurry() const;
1595   inline isl::map unite(isl::basic_map bmap2) const;
1596   inline isl::map unite(const isl::map &map2) const;
1597   inline isl::union_map unite(const isl::union_map &umap2) const;
1598   inline isl::basic_map unshifted_simple_hull() const;
1599   inline isl::map upper_bound(const isl::multi_pw_aff &upper) const;
1600   inline isl::set wrap() const;
1601   inline isl::map zip() const;
1602 };
1603 
1604 // declarations for isl::basic_set
1605 inline basic_set manage(__isl_take isl_basic_set *ptr);
1606 inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1607 
1608 class basic_set {
1609   friend inline basic_set manage(__isl_take isl_basic_set *ptr);
1610   friend inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1611 
1612 protected:
1613   isl_basic_set *ptr = nullptr;
1614 
1615   inline explicit basic_set(__isl_take isl_basic_set *ptr);
1616 
1617 public:
1618   inline /* implicit */ basic_set();
1619   inline /* implicit */ basic_set(const basic_set &obj);
1620   inline /* implicit */ basic_set(isl::point pnt);
1621   inline explicit basic_set(isl::ctx ctx, const std::string &str);
1622   inline basic_set &operator=(basic_set obj);
1623   inline ~basic_set();
1624   inline __isl_give isl_basic_set *copy() const &;
1625   inline __isl_give isl_basic_set *copy() && = delete;
1626   inline __isl_keep isl_basic_set *get() const;
1627   inline __isl_give isl_basic_set *release();
1628   inline bool is_null() const;
1629   inline isl::ctx ctx() const;
1630 
1631   inline isl::basic_set affine_hull() const;
1632   inline isl::basic_set apply(isl::basic_map bmap) const;
1633   inline isl::set apply(const isl::map &map) const;
1634   inline isl::union_set apply(const isl::union_map &umap) const;
1635   inline isl::pw_multi_aff as_pw_multi_aff() const;
1636   inline isl::set as_set() const;
1637   inline isl::set bind(const isl::multi_id &tuple) const;
1638   inline isl::set coalesce() const;
1639   inline isl::set complement() const;
1640   inline isl::union_set compute_divs() const;
1641   inline isl::basic_set detect_equalities() const;
1642   inline isl::val dim_max_val(int pos) const;
1643   inline isl::val dim_min_val(int pos) const;
1644   inline bool every_set(const std::function<bool(isl::set)> &test) const;
1645   inline isl::set extract_set(const isl::space &space) const;
1646   inline isl::basic_set flatten() const;
1647   inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
1648   inline void foreach_point(const std::function<void(isl::point)> &fn) const;
1649   inline void foreach_set(const std::function<void(isl::set)> &fn) const;
1650   inline isl::basic_set gist(isl::basic_set context) const;
1651   inline isl::set gist(const isl::set &context) const;
1652   inline isl::union_set gist(const isl::union_set &context) const;
1653   inline isl::basic_set gist(const isl::point &context) const;
1654   inline isl::union_set gist_params(const isl::set &set) const;
1655   inline isl::map identity() const;
1656   inline isl::pw_aff indicator_function() const;
1657   inline isl::map insert_domain(const isl::space &domain) const;
1658   inline isl::basic_set intersect(isl::basic_set bset2) const;
1659   inline isl::set intersect(const isl::set &set2) const;
1660   inline isl::union_set intersect(const isl::union_set &uset2) const;
1661   inline isl::basic_set intersect(const isl::point &bset2) const;
1662   inline isl::basic_set intersect_params(isl::basic_set bset2) const;
1663   inline isl::set intersect_params(const isl::set &params) const;
1664   inline isl::basic_set intersect_params(const isl::point &bset2) const;
1665   inline bool involves_locals() const;
1666   inline bool is_disjoint(const isl::set &set2) const;
1667   inline bool is_disjoint(const isl::union_set &uset2) const;
1668   inline bool is_empty() const;
1669   inline bool is_equal(const isl::basic_set &bset2) const;
1670   inline bool is_equal(const isl::set &set2) const;
1671   inline bool is_equal(const isl::union_set &uset2) const;
1672   inline bool is_equal(const isl::point &bset2) const;
1673   inline bool is_singleton() const;
1674   inline bool is_strict_subset(const isl::set &set2) const;
1675   inline bool is_strict_subset(const isl::union_set &uset2) const;
1676   inline bool is_subset(const isl::basic_set &bset2) const;
1677   inline bool is_subset(const isl::set &set2) const;
1678   inline bool is_subset(const isl::union_set &uset2) const;
1679   inline bool is_subset(const isl::point &bset2) const;
1680   inline bool is_wrapping() const;
1681   inline bool isa_set() const;
1682   inline isl::set lexmax() const;
1683   inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1684   inline isl::set lexmin() const;
1685   inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1686   inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
1687   inline isl::set lower_bound(const isl::multi_val &lower) const;
1688   inline isl::multi_pw_aff max_multi_pw_aff() const;
1689   inline isl::val max_val(const isl::aff &obj) const;
1690   inline isl::multi_pw_aff min_multi_pw_aff() const;
1691   inline isl::val min_val(const isl::aff &obj) const;
1692   inline unsigned n_basic_set() const;
1693   inline isl::basic_set params() const;
1694   inline isl::multi_val plain_multi_val_if_fixed() const;
1695   inline isl::basic_set polyhedral_hull() const;
1696   inline isl::set preimage(const isl::multi_aff &ma) const;
1697   inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
1698   inline isl::set preimage(const isl::pw_multi_aff &pma) const;
1699   inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
1700   inline isl::set product(const isl::set &set2) const;
1701   inline isl::set project_out_all_params() const;
1702   inline isl::set project_out_param(const isl::id &id) const;
1703   inline isl::set project_out_param(const std::string &id) const;
1704   inline isl::set project_out_param(const isl::id_list &list) const;
1705   inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
1706   inline isl::basic_set sample() const;
1707   inline isl::point sample_point() const;
1708   inline isl::set_list set_list() const;
1709   inline isl::fixed_box simple_fixed_box_hull() const;
1710   inline isl::space space() const;
1711   inline isl::val stride(int pos) const;
1712   inline isl::set subtract(const isl::set &set2) const;
1713   inline isl::union_set subtract(const isl::union_set &uset2) const;
1714   inline isl::set_list to_list() const;
1715   inline isl::set to_set() const;
1716   inline isl::union_set to_union_set() const;
1717   inline isl::map translation() const;
1718   inline unsigned tuple_dim() const;
1719   inline isl::set unbind_params(const isl::multi_id &tuple) const;
1720   inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
1721   inline isl::set unite(isl::basic_set bset2) const;
1722   inline isl::set unite(const isl::set &set2) const;
1723   inline isl::union_set unite(const isl::union_set &uset2) const;
1724   inline isl::set unite(const isl::point &bset2) const;
1725   inline isl::basic_set unshifted_simple_hull() const;
1726   inline isl::map unwrap() const;
1727   inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
1728   inline isl::set upper_bound(const isl::multi_val &upper) const;
1729 };
1730 
1731 // declarations for isl::fixed_box
1732 inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1733 inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1734 
1735 class fixed_box {
1736   friend inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1737   friend inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1738 
1739 protected:
1740   isl_fixed_box *ptr = nullptr;
1741 
1742   inline explicit fixed_box(__isl_take isl_fixed_box *ptr);
1743 
1744 public:
1745   inline /* implicit */ fixed_box();
1746   inline /* implicit */ fixed_box(const fixed_box &obj);
1747   inline fixed_box &operator=(fixed_box obj);
1748   inline ~fixed_box();
1749   inline __isl_give isl_fixed_box *copy() const &;
1750   inline __isl_give isl_fixed_box *copy() && = delete;
1751   inline __isl_keep isl_fixed_box *get() const;
1752   inline __isl_give isl_fixed_box *release();
1753   inline bool is_null() const;
1754   inline isl::ctx ctx() const;
1755 
1756   inline bool is_valid() const;
1757   inline isl::multi_aff offset() const;
1758   inline isl::multi_aff get_offset() const;
1759   inline isl::multi_val size() const;
1760   inline isl::multi_val get_size() const;
1761   inline isl::space space() const;
1762   inline isl::space get_space() const;
1763 };
1764 
1765 // declarations for isl::id
1766 inline id manage(__isl_take isl_id *ptr);
1767 inline id manage_copy(__isl_keep isl_id *ptr);
1768 
1769 class id {
1770   friend inline id manage(__isl_take isl_id *ptr);
1771   friend inline id manage_copy(__isl_keep isl_id *ptr);
1772 
1773 protected:
1774   isl_id *ptr = nullptr;
1775 
1776   inline explicit id(__isl_take isl_id *ptr);
1777 
1778 public:
1779   inline /* implicit */ id();
1780   inline /* implicit */ id(const id &obj);
1781   inline explicit id(isl::ctx ctx, const std::string &str);
1782   inline id &operator=(id obj);
1783   inline ~id();
1784   inline __isl_give isl_id *copy() const &;
1785   inline __isl_give isl_id *copy() && = delete;
1786   inline __isl_keep isl_id *get() const;
1787   inline __isl_give isl_id *release();
1788   inline bool is_null() const;
1789   inline isl::ctx ctx() const;
1790 
1791   inline std::string name() const;
1792   inline std::string get_name() const;
1793   inline isl::id_list to_list() const;
1794 };
1795 
1796 // declarations for isl::id_list
1797 inline id_list manage(__isl_take isl_id_list *ptr);
1798 inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1799 
1800 class id_list {
1801   friend inline id_list manage(__isl_take isl_id_list *ptr);
1802   friend inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1803 
1804 protected:
1805   isl_id_list *ptr = nullptr;
1806 
1807   inline explicit id_list(__isl_take isl_id_list *ptr);
1808 
1809 public:
1810   inline /* implicit */ id_list();
1811   inline /* implicit */ id_list(const id_list &obj);
1812   inline explicit id_list(isl::ctx ctx, int n);
1813   inline explicit id_list(isl::id el);
1814   inline explicit id_list(isl::ctx ctx, const std::string &str);
1815   inline id_list &operator=(id_list obj);
1816   inline ~id_list();
1817   inline __isl_give isl_id_list *copy() const &;
1818   inline __isl_give isl_id_list *copy() && = delete;
1819   inline __isl_keep isl_id_list *get() const;
1820   inline __isl_give isl_id_list *release();
1821   inline bool is_null() const;
1822   inline isl::ctx ctx() const;
1823 
1824   inline isl::id_list add(isl::id el) const;
1825   inline isl::id_list add(const std::string &el) const;
1826   inline isl::id at(int index) const;
1827   inline isl::id get_at(int index) const;
1828   inline isl::id_list clear() const;
1829   inline isl::id_list concat(isl::id_list list2) const;
1830   inline isl::id_list drop(unsigned int first, unsigned int n) const;
1831   inline void foreach(const std::function<void(isl::id)> &fn) const;
1832   inline isl::id_list insert(unsigned int pos, isl::id el) const;
1833   inline isl::id_list insert(unsigned int pos, const std::string &el) const;
1834   inline unsigned size() const;
1835 };
1836 
1837 // declarations for isl::map
1838 inline map manage(__isl_take isl_map *ptr);
1839 inline map manage_copy(__isl_keep isl_map *ptr);
1840 
1841 class map {
1842   friend inline map manage(__isl_take isl_map *ptr);
1843   friend inline map manage_copy(__isl_keep isl_map *ptr);
1844 
1845 protected:
1846   isl_map *ptr = nullptr;
1847 
1848   inline explicit map(__isl_take isl_map *ptr);
1849 
1850 public:
1851   inline /* implicit */ map();
1852   inline /* implicit */ map(const map &obj);
1853   inline /* implicit */ map(isl::basic_map bmap);
1854   inline explicit map(isl::ctx ctx, const std::string &str);
1855   inline map &operator=(map obj);
1856   inline ~map();
1857   inline __isl_give isl_map *copy() const &;
1858   inline __isl_give isl_map *copy() && = delete;
1859   inline __isl_keep isl_map *get() const;
1860   inline __isl_give isl_map *release();
1861   inline bool is_null() const;
1862   inline isl::ctx ctx() const;
1863 
1864   inline isl::basic_map affine_hull() const;
1865   inline isl::map apply_domain(isl::map map2) const;
1866   inline isl::union_map apply_domain(const isl::union_map &umap2) const;
1867   inline isl::map apply_domain(const isl::basic_map &map2) const;
1868   inline isl::map apply_range(isl::map map2) const;
1869   inline isl::union_map apply_range(const isl::union_map &umap2) const;
1870   inline isl::map apply_range(const isl::basic_map &map2) const;
1871   inline isl::map as_map() const;
1872   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
1873   inline isl::pw_multi_aff as_pw_multi_aff() const;
1874   inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
1875   inline isl::set bind_domain(isl::multi_id tuple) const;
1876   inline isl::set bind_range(isl::multi_id tuple) const;
1877   inline isl::map coalesce() const;
1878   inline isl::map complement() const;
1879   inline isl::union_map compute_divs() const;
1880   inline isl::map curry() const;
1881   inline isl::set deltas() const;
1882   inline isl::map detect_equalities() const;
1883   inline isl::set domain() const;
1884   inline isl::map domain_factor_domain() const;
1885   inline isl::map domain_factor_range() const;
1886   inline isl::union_map domain_map() const;
1887   inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
1888   inline isl::map domain_product(isl::map map2) const;
1889   inline isl::union_map domain_product(const isl::union_map &umap2) const;
1890   inline isl::map domain_product(const isl::basic_map &map2) const;
1891   inline unsigned domain_tuple_dim() const;
1892   inline isl::id domain_tuple_id() const;
1893   inline isl::id get_domain_tuple_id() const;
1894   static inline isl::map empty(isl::space space);
1895   inline isl::map eq_at(isl::multi_pw_aff mpa) const;
1896   inline isl::union_map eq_at(const isl::multi_union_pw_aff &mupa) const;
1897   inline isl::map eq_at(const isl::aff &mpa) const;
1898   inline isl::map eq_at(const isl::multi_aff &mpa) const;
1899   inline isl::map eq_at(const isl::pw_aff &mpa) const;
1900   inline isl::map eq_at(const isl::pw_multi_aff &mpa) const;
1901   inline bool every_map(const std::function<bool(isl::map)> &test) const;
1902   inline isl::map extract_map(const isl::space &space) const;
1903   inline isl::map factor_domain() const;
1904   inline isl::map factor_range() const;
1905   inline isl::union_map fixed_power(const isl::val &exp) const;
1906   inline isl::union_map fixed_power(long exp) const;
1907   inline isl::map flatten() const;
1908   inline isl::map flatten_domain() const;
1909   inline isl::map flatten_range() const;
1910   inline void foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const;
1911   inline void foreach_map(const std::function<void(isl::map)> &fn) const;
1912   inline isl::map gist(isl::map context) const;
1913   inline isl::union_map gist(const isl::union_map &context) const;
1914   inline isl::map gist(const isl::basic_map &context) const;
1915   inline isl::map gist_domain(isl::set context) const;
1916   inline isl::union_map gist_domain(const isl::union_set &uset) const;
1917   inline isl::map gist_domain(const isl::basic_set &context) const;
1918   inline isl::map gist_domain(const isl::point &context) const;
1919   inline isl::union_map gist_params(const isl::set &set) const;
1920   inline isl::union_map gist_range(const isl::union_set &uset) const;
1921   inline bool has_domain_tuple_id() const;
1922   inline bool has_range_tuple_id() const;
1923   inline isl::map intersect(isl::map map2) const;
1924   inline isl::union_map intersect(const isl::union_map &umap2) const;
1925   inline isl::map intersect(const isl::basic_map &map2) const;
1926   inline isl::map intersect_domain(isl::set set) const;
1927   inline isl::union_map intersect_domain(const isl::space &space) const;
1928   inline isl::union_map intersect_domain(const isl::union_set &uset) const;
1929   inline isl::map intersect_domain(const isl::basic_set &set) const;
1930   inline isl::map intersect_domain(const isl::point &set) const;
1931   inline isl::map intersect_domain_factor_domain(isl::map factor) const;
1932   inline isl::union_map intersect_domain_factor_domain(const isl::union_map &factor) const;
1933   inline isl::map intersect_domain_factor_domain(const isl::basic_map &factor) const;
1934   inline isl::map intersect_domain_factor_range(isl::map factor) const;
1935   inline isl::union_map intersect_domain_factor_range(const isl::union_map &factor) const;
1936   inline isl::map intersect_domain_factor_range(const isl::basic_map &factor) const;
1937   inline isl::map intersect_params(isl::set params) const;
1938   inline isl::map intersect_range(isl::set set) const;
1939   inline isl::union_map intersect_range(const isl::space &space) const;
1940   inline isl::union_map intersect_range(const isl::union_set &uset) const;
1941   inline isl::map intersect_range(const isl::basic_set &set) const;
1942   inline isl::map intersect_range(const isl::point &set) const;
1943   inline isl::map intersect_range_factor_domain(isl::map factor) const;
1944   inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
1945   inline isl::map intersect_range_factor_domain(const isl::basic_map &factor) const;
1946   inline isl::map intersect_range_factor_range(isl::map factor) const;
1947   inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
1948   inline isl::map intersect_range_factor_range(const isl::basic_map &factor) const;
1949   inline bool is_bijective() const;
1950   inline bool is_disjoint(const isl::map &map2) const;
1951   inline bool is_disjoint(const isl::union_map &umap2) const;
1952   inline bool is_disjoint(const isl::basic_map &map2) const;
1953   inline bool is_empty() const;
1954   inline bool is_equal(const isl::map &map2) const;
1955   inline bool is_equal(const isl::union_map &umap2) const;
1956   inline bool is_equal(const isl::basic_map &map2) const;
1957   inline bool is_injective() const;
1958   inline bool is_single_valued() const;
1959   inline bool is_strict_subset(const isl::map &map2) const;
1960   inline bool is_strict_subset(const isl::union_map &umap2) const;
1961   inline bool is_strict_subset(const isl::basic_map &map2) const;
1962   inline bool is_subset(const isl::map &map2) const;
1963   inline bool is_subset(const isl::union_map &umap2) const;
1964   inline bool is_subset(const isl::basic_map &map2) const;
1965   inline bool isa_map() const;
1966   inline isl::map lex_ge_at(isl::multi_pw_aff mpa) const;
1967   inline isl::map lex_gt_at(isl::multi_pw_aff mpa) const;
1968   inline isl::map lex_le_at(isl::multi_pw_aff mpa) const;
1969   inline isl::map lex_lt_at(isl::multi_pw_aff mpa) const;
1970   inline isl::map lexmax() const;
1971   inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1972   inline isl::map lexmin() const;
1973   inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1974   inline isl::map lower_bound(isl::multi_pw_aff lower) const;
1975   inline isl::map_list map_list() const;
1976   inline isl::multi_pw_aff max_multi_pw_aff() const;
1977   inline isl::multi_pw_aff min_multi_pw_aff() const;
1978   inline unsigned n_basic_map() const;
1979   inline isl::basic_map polyhedral_hull() const;
1980   inline isl::map preimage_domain(isl::multi_aff ma) const;
1981   inline isl::map preimage_domain(isl::multi_pw_aff mpa) const;
1982   inline isl::map preimage_domain(isl::pw_multi_aff pma) const;
1983   inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
1984   inline isl::map preimage_range(isl::multi_aff ma) const;
1985   inline isl::map preimage_range(isl::pw_multi_aff pma) const;
1986   inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
1987   inline isl::map product(isl::map map2) const;
1988   inline isl::union_map product(const isl::union_map &umap2) const;
1989   inline isl::map product(const isl::basic_map &map2) const;
1990   inline isl::map project_out_all_params() const;
1991   inline isl::set range() const;
1992   inline isl::map range_factor_domain() const;
1993   inline isl::map range_factor_range() const;
1994   inline isl::fixed_box range_lattice_tile() const;
1995   inline isl::fixed_box get_range_lattice_tile() const;
1996   inline isl::union_map range_map() const;
1997   inline isl::map range_product(isl::map map2) const;
1998   inline isl::union_map range_product(const isl::union_map &umap2) const;
1999   inline isl::map range_product(const isl::basic_map &map2) const;
2000   inline isl::map range_reverse() const;
2001   inline isl::fixed_box range_simple_fixed_box_hull() const;
2002   inline isl::fixed_box get_range_simple_fixed_box_hull() const;
2003   inline unsigned range_tuple_dim() const;
2004   inline isl::id range_tuple_id() const;
2005   inline isl::id get_range_tuple_id() const;
2006   inline isl::map reverse() const;
2007   inline isl::basic_map sample() const;
2008   inline isl::map set_domain_tuple(isl::id id) const;
2009   inline isl::map set_domain_tuple(const std::string &id) const;
2010   inline isl::map set_range_tuple(isl::id id) const;
2011   inline isl::map set_range_tuple(const std::string &id) const;
2012   inline isl::space space() const;
2013   inline isl::space get_space() const;
2014   inline isl::map subtract(isl::map map2) const;
2015   inline isl::union_map subtract(const isl::union_map &umap2) const;
2016   inline isl::map subtract(const isl::basic_map &map2) const;
2017   inline isl::union_map subtract_domain(const isl::union_set &dom) const;
2018   inline isl::union_map subtract_range(const isl::union_set &dom) const;
2019   inline isl::map_list to_list() const;
2020   inline isl::union_map to_union_map() const;
2021   inline isl::map uncurry() const;
2022   inline isl::map unite(isl::map map2) const;
2023   inline isl::union_map unite(const isl::union_map &umap2) const;
2024   inline isl::map unite(const isl::basic_map &map2) const;
2025   static inline isl::map universe(isl::space space);
2026   inline isl::basic_map unshifted_simple_hull() const;
2027   inline isl::map upper_bound(isl::multi_pw_aff upper) const;
2028   inline isl::set wrap() const;
2029   inline isl::map zip() const;
2030 };
2031 
2032 // declarations for isl::map_list
2033 inline map_list manage(__isl_take isl_map_list *ptr);
2034 inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2035 
2036 class map_list {
2037   friend inline map_list manage(__isl_take isl_map_list *ptr);
2038   friend inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2039 
2040 protected:
2041   isl_map_list *ptr = nullptr;
2042 
2043   inline explicit map_list(__isl_take isl_map_list *ptr);
2044 
2045 public:
2046   inline /* implicit */ map_list();
2047   inline /* implicit */ map_list(const map_list &obj);
2048   inline explicit map_list(isl::ctx ctx, int n);
2049   inline explicit map_list(isl::map el);
2050   inline explicit map_list(isl::ctx ctx, const std::string &str);
2051   inline map_list &operator=(map_list obj);
2052   inline ~map_list();
2053   inline __isl_give isl_map_list *copy() const &;
2054   inline __isl_give isl_map_list *copy() && = delete;
2055   inline __isl_keep isl_map_list *get() const;
2056   inline __isl_give isl_map_list *release();
2057   inline bool is_null() const;
2058   inline isl::ctx ctx() const;
2059 
2060   inline isl::map_list add(isl::map el) const;
2061   inline isl::map at(int index) const;
2062   inline isl::map get_at(int index) const;
2063   inline isl::map_list clear() const;
2064   inline isl::map_list concat(isl::map_list list2) const;
2065   inline isl::map_list drop(unsigned int first, unsigned int n) const;
2066   inline void foreach(const std::function<void(isl::map)> &fn) const;
2067   inline isl::map_list insert(unsigned int pos, isl::map el) const;
2068   inline unsigned size() const;
2069 };
2070 
2071 // declarations for isl::multi_aff
2072 inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2073 inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2074 
2075 class multi_aff {
2076   friend inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2077   friend inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2078 
2079 protected:
2080   isl_multi_aff *ptr = nullptr;
2081 
2082   inline explicit multi_aff(__isl_take isl_multi_aff *ptr);
2083 
2084 public:
2085   inline /* implicit */ multi_aff();
2086   inline /* implicit */ multi_aff(const multi_aff &obj);
2087   inline /* implicit */ multi_aff(isl::aff aff);
2088   inline explicit multi_aff(isl::space space, isl::aff_list list);
2089   inline explicit multi_aff(isl::ctx ctx, const std::string &str);
2090   inline multi_aff &operator=(multi_aff obj);
2091   inline ~multi_aff();
2092   inline __isl_give isl_multi_aff *copy() const &;
2093   inline __isl_give isl_multi_aff *copy() && = delete;
2094   inline __isl_keep isl_multi_aff *get() const;
2095   inline __isl_give isl_multi_aff *release();
2096   inline bool is_null() const;
2097   inline isl::ctx ctx() const;
2098 
2099   inline isl::multi_aff add(isl::multi_aff multi2) const;
2100   inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2101   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2102   inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2103   inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2104   inline isl::multi_aff add(const isl::aff &multi2) const;
2105   inline isl::multi_aff add_constant(isl::multi_val mv) const;
2106   inline isl::multi_aff add_constant(isl::val v) const;
2107   inline isl::multi_aff add_constant(long v) const;
2108   inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2109   inline isl::map as_map() const;
2110   inline isl::multi_aff as_multi_aff() const;
2111   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2112   inline isl::pw_multi_aff as_pw_multi_aff() const;
2113   inline isl::set as_set() const;
2114   inline isl::union_map as_union_map() const;
2115   inline isl::aff at(int pos) const;
2116   inline isl::aff get_at(int pos) const;
2117   inline isl::basic_set bind(isl::multi_id tuple) const;
2118   inline isl::multi_aff bind_domain(isl::multi_id tuple) const;
2119   inline isl::multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2120   inline isl::pw_multi_aff coalesce() const;
2121   inline isl::multi_val constant_multi_val() const;
2122   inline isl::multi_val get_constant_multi_val() const;
2123   inline isl::set domain() const;
2124   static inline isl::multi_aff domain_map(isl::space space);
2125   inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2126   inline isl::multi_aff flat_range_product(isl::multi_aff multi2) const;
2127   inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2128   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2129   inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2130   inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2131   inline isl::multi_aff flat_range_product(const isl::aff &multi2) const;
2132   inline isl::multi_aff floor() const;
2133   inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2134   inline isl::multi_aff gist(isl::set context) const;
2135   inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
2136   inline isl::multi_aff gist(const isl::basic_set &context) const;
2137   inline isl::multi_aff gist(const isl::point &context) const;
2138   inline bool has_range_tuple_id() const;
2139   inline isl::multi_aff identity() const;
2140   static inline isl::multi_aff identity_on_domain(isl::space space);
2141   inline isl::multi_aff insert_domain(isl::space domain) const;
2142   inline isl::pw_multi_aff intersect_domain(const isl::set &set) const;
2143   inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
2144   inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
2145   inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2146   inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2147   inline isl::pw_multi_aff intersect_params(const isl::set &set) const;
2148   inline bool involves_locals() const;
2149   inline bool involves_nan() const;
2150   inline bool involves_param(const isl::id &id) const;
2151   inline bool involves_param(const std::string &id) const;
2152   inline bool involves_param(const isl::id_list &list) const;
2153   inline bool isa_multi_aff() const;
2154   inline bool isa_pw_multi_aff() const;
2155   inline isl::aff_list list() const;
2156   inline isl::aff_list get_list() const;
2157   inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2158   inline isl::multi_val max_multi_val() const;
2159   inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2160   inline isl::multi_val min_multi_val() const;
2161   static inline isl::multi_aff multi_val_on_domain(isl::space space, isl::multi_val mv);
2162   inline unsigned n_piece() const;
2163   inline isl::multi_aff neg() const;
2164   inline bool plain_is_empty() const;
2165   inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2166   inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2167   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2168   inline bool plain_is_equal(const isl::aff &multi2) const;
2169   inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2170   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2171   inline isl::multi_aff product(isl::multi_aff multi2) const;
2172   inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2173   inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2174   inline isl::multi_aff product(const isl::aff &multi2) const;
2175   inline isl::multi_aff pullback(isl::multi_aff ma2) const;
2176   inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
2177   inline isl::pw_multi_aff pullback(const isl::pw_multi_aff &pma2) const;
2178   inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
2179   inline isl::multi_aff pullback(const isl::aff &ma2) const;
2180   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2181   inline isl::pw_multi_aff range_factor_domain() const;
2182   inline isl::pw_multi_aff range_factor_range() const;
2183   static inline isl::multi_aff range_map(isl::space space);
2184   inline isl::multi_aff range_product(isl::multi_aff multi2) const;
2185   inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2186   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2187   inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2188   inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2189   inline isl::multi_aff range_product(const isl::aff &multi2) const;
2190   inline isl::id range_tuple_id() const;
2191   inline isl::id get_range_tuple_id() const;
2192   inline isl::multi_aff reset_range_tuple_id() const;
2193   inline isl::multi_aff scale(isl::multi_val mv) const;
2194   inline isl::multi_aff scale(isl::val v) const;
2195   inline isl::multi_aff scale(long v) const;
2196   inline isl::multi_aff scale_down(isl::multi_val mv) const;
2197   inline isl::multi_aff scale_down(isl::val v) const;
2198   inline isl::multi_aff scale_down(long v) const;
2199   inline isl::multi_aff set_at(int pos, isl::aff el) const;
2200   inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2201   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2202   inline isl::multi_aff set_range_tuple(isl::id id) const;
2203   inline isl::multi_aff set_range_tuple(const std::string &id) const;
2204   inline unsigned size() const;
2205   inline isl::space space() const;
2206   inline isl::space get_space() const;
2207   inline isl::multi_aff sub(isl::multi_aff multi2) const;
2208   inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2209   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2210   inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2211   inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2212   inline isl::multi_aff sub(const isl::aff &multi2) const;
2213   inline isl::pw_multi_aff subtract_domain(const isl::set &set) const;
2214   inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
2215   inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
2216   inline isl::pw_multi_aff_list to_list() const;
2217   inline isl::multi_pw_aff to_multi_pw_aff() const;
2218   inline isl::multi_union_pw_aff to_multi_union_pw_aff() const;
2219   inline isl::pw_multi_aff to_pw_multi_aff() const;
2220   inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2221   inline isl::multi_aff unbind_params_insert_domain(isl::multi_id domain) const;
2222   inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2223   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2224   inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2225   inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2226   static inline isl::multi_aff zero(isl::space space);
2227 };
2228 
2229 // declarations for isl::multi_id
2230 inline multi_id manage(__isl_take isl_multi_id *ptr);
2231 inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2232 
2233 class multi_id {
2234   friend inline multi_id manage(__isl_take isl_multi_id *ptr);
2235   friend inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2236 
2237 protected:
2238   isl_multi_id *ptr = nullptr;
2239 
2240   inline explicit multi_id(__isl_take isl_multi_id *ptr);
2241 
2242 public:
2243   inline /* implicit */ multi_id();
2244   inline /* implicit */ multi_id(const multi_id &obj);
2245   inline explicit multi_id(isl::space space, isl::id_list list);
2246   inline explicit multi_id(isl::ctx ctx, const std::string &str);
2247   inline multi_id &operator=(multi_id obj);
2248   inline ~multi_id();
2249   inline __isl_give isl_multi_id *copy() const &;
2250   inline __isl_give isl_multi_id *copy() && = delete;
2251   inline __isl_keep isl_multi_id *get() const;
2252   inline __isl_give isl_multi_id *release();
2253   inline bool is_null() const;
2254   inline isl::ctx ctx() const;
2255 
2256   inline isl::id at(int pos) const;
2257   inline isl::id get_at(int pos) const;
2258   inline isl::multi_id flat_range_product(isl::multi_id multi2) const;
2259   inline isl::id_list list() const;
2260   inline isl::id_list get_list() const;
2261   inline bool plain_is_equal(const isl::multi_id &multi2) const;
2262   inline isl::multi_id range_product(isl::multi_id multi2) const;
2263   inline isl::multi_id set_at(int pos, isl::id el) const;
2264   inline isl::multi_id set_at(int pos, const std::string &el) const;
2265   inline unsigned size() const;
2266   inline isl::space space() const;
2267   inline isl::space get_space() const;
2268 };
2269 
2270 // declarations for isl::multi_pw_aff
2271 inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2272 inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2273 
2274 class multi_pw_aff {
2275   friend inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2276   friend inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2277 
2278 protected:
2279   isl_multi_pw_aff *ptr = nullptr;
2280 
2281   inline explicit multi_pw_aff(__isl_take isl_multi_pw_aff *ptr);
2282 
2283 public:
2284   inline /* implicit */ multi_pw_aff();
2285   inline /* implicit */ multi_pw_aff(const multi_pw_aff &obj);
2286   inline /* implicit */ multi_pw_aff(isl::aff aff);
2287   inline /* implicit */ multi_pw_aff(isl::multi_aff ma);
2288   inline /* implicit */ multi_pw_aff(isl::pw_aff pa);
2289   inline explicit multi_pw_aff(isl::space space, isl::pw_aff_list list);
2290   inline /* implicit */ multi_pw_aff(isl::pw_multi_aff pma);
2291   inline explicit multi_pw_aff(isl::ctx ctx, const std::string &str);
2292   inline multi_pw_aff &operator=(multi_pw_aff obj);
2293   inline ~multi_pw_aff();
2294   inline __isl_give isl_multi_pw_aff *copy() const &;
2295   inline __isl_give isl_multi_pw_aff *copy() && = delete;
2296   inline __isl_keep isl_multi_pw_aff *get() const;
2297   inline __isl_give isl_multi_pw_aff *release();
2298   inline bool is_null() const;
2299   inline isl::ctx ctx() const;
2300 
2301   inline isl::multi_pw_aff add(isl::multi_pw_aff multi2) const;
2302   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2303   inline isl::multi_pw_aff add(const isl::aff &multi2) const;
2304   inline isl::multi_pw_aff add(const isl::multi_aff &multi2) const;
2305   inline isl::multi_pw_aff add(const isl::pw_aff &multi2) const;
2306   inline isl::multi_pw_aff add(const isl::pw_multi_aff &multi2) const;
2307   inline isl::multi_pw_aff add_constant(isl::multi_val mv) const;
2308   inline isl::multi_pw_aff add_constant(isl::val v) const;
2309   inline isl::multi_pw_aff add_constant(long v) const;
2310   inline isl::map as_map() const;
2311   inline isl::multi_aff as_multi_aff() const;
2312   inline isl::set as_set() const;
2313   inline isl::pw_aff at(int pos) const;
2314   inline isl::pw_aff get_at(int pos) const;
2315   inline isl::set bind(isl::multi_id tuple) const;
2316   inline isl::multi_pw_aff bind_domain(isl::multi_id tuple) const;
2317   inline isl::multi_pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2318   inline isl::multi_pw_aff coalesce() const;
2319   inline isl::set domain() const;
2320   inline isl::multi_pw_aff flat_range_product(isl::multi_pw_aff multi2) const;
2321   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2322   inline isl::multi_pw_aff flat_range_product(const isl::aff &multi2) const;
2323   inline isl::multi_pw_aff flat_range_product(const isl::multi_aff &multi2) const;
2324   inline isl::multi_pw_aff flat_range_product(const isl::pw_aff &multi2) const;
2325   inline isl::multi_pw_aff flat_range_product(const isl::pw_multi_aff &multi2) const;
2326   inline isl::multi_pw_aff gist(isl::set set) const;
2327   inline isl::multi_union_pw_aff gist(const isl::union_set &context) const;
2328   inline isl::multi_pw_aff gist(const isl::basic_set &set) const;
2329   inline isl::multi_pw_aff gist(const isl::point &set) const;
2330   inline bool has_range_tuple_id() const;
2331   inline isl::multi_pw_aff identity() const;
2332   static inline isl::multi_pw_aff identity_on_domain(isl::space space);
2333   inline isl::multi_pw_aff insert_domain(isl::space domain) const;
2334   inline isl::multi_pw_aff intersect_domain(isl::set domain) const;
2335   inline isl::multi_union_pw_aff intersect_domain(const isl::union_set &uset) const;
2336   inline isl::multi_pw_aff intersect_domain(const isl::basic_set &domain) const;
2337   inline isl::multi_pw_aff intersect_domain(const isl::point &domain) const;
2338   inline isl::multi_pw_aff intersect_params(isl::set set) const;
2339   inline bool involves_nan() const;
2340   inline bool involves_param(const isl::id &id) const;
2341   inline bool involves_param(const std::string &id) const;
2342   inline bool involves_param(const isl::id_list &list) const;
2343   inline bool isa_multi_aff() const;
2344   inline isl::pw_aff_list list() const;
2345   inline isl::pw_aff_list get_list() const;
2346   inline isl::multi_pw_aff max(isl::multi_pw_aff multi2) const;
2347   inline isl::multi_val max_multi_val() const;
2348   inline isl::multi_pw_aff min(isl::multi_pw_aff multi2) const;
2349   inline isl::multi_val min_multi_val() const;
2350   inline isl::multi_pw_aff neg() const;
2351   inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2352   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2353   inline bool plain_is_equal(const isl::aff &multi2) const;
2354   inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2355   inline bool plain_is_equal(const isl::pw_aff &multi2) const;
2356   inline bool plain_is_equal(const isl::pw_multi_aff &multi2) const;
2357   inline isl::multi_pw_aff product(isl::multi_pw_aff multi2) const;
2358   inline isl::multi_pw_aff pullback(isl::multi_aff ma) const;
2359   inline isl::multi_pw_aff pullback(isl::multi_pw_aff mpa2) const;
2360   inline isl::multi_pw_aff pullback(isl::pw_multi_aff pma) const;
2361   inline isl::multi_union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2362   inline isl::multi_pw_aff range_product(isl::multi_pw_aff multi2) const;
2363   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2364   inline isl::multi_pw_aff range_product(const isl::aff &multi2) const;
2365   inline isl::multi_pw_aff range_product(const isl::multi_aff &multi2) const;
2366   inline isl::multi_pw_aff range_product(const isl::pw_aff &multi2) const;
2367   inline isl::multi_pw_aff range_product(const isl::pw_multi_aff &multi2) const;
2368   inline isl::id range_tuple_id() const;
2369   inline isl::id get_range_tuple_id() const;
2370   inline isl::multi_pw_aff reset_range_tuple_id() const;
2371   inline isl::multi_pw_aff scale(isl::multi_val mv) const;
2372   inline isl::multi_pw_aff scale(isl::val v) const;
2373   inline isl::multi_pw_aff scale(long v) const;
2374   inline isl::multi_pw_aff scale_down(isl::multi_val mv) const;
2375   inline isl::multi_pw_aff scale_down(isl::val v) const;
2376   inline isl::multi_pw_aff scale_down(long v) const;
2377   inline isl::multi_pw_aff set_at(int pos, isl::pw_aff el) const;
2378   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2379   inline isl::multi_pw_aff set_range_tuple(isl::id id) const;
2380   inline isl::multi_pw_aff set_range_tuple(const std::string &id) const;
2381   inline unsigned size() const;
2382   inline isl::space space() const;
2383   inline isl::space get_space() const;
2384   inline isl::multi_pw_aff sub(isl::multi_pw_aff multi2) const;
2385   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2386   inline isl::multi_pw_aff sub(const isl::aff &multi2) const;
2387   inline isl::multi_pw_aff sub(const isl::multi_aff &multi2) const;
2388   inline isl::multi_pw_aff sub(const isl::pw_aff &multi2) const;
2389   inline isl::multi_pw_aff sub(const isl::pw_multi_aff &multi2) const;
2390   inline isl::multi_pw_aff unbind_params_insert_domain(isl::multi_id domain) const;
2391   inline isl::multi_pw_aff union_add(isl::multi_pw_aff mpa2) const;
2392   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2393   inline isl::multi_pw_aff union_add(const isl::aff &mpa2) const;
2394   inline isl::multi_pw_aff union_add(const isl::multi_aff &mpa2) const;
2395   inline isl::multi_pw_aff union_add(const isl::pw_aff &mpa2) const;
2396   inline isl::multi_pw_aff union_add(const isl::pw_multi_aff &mpa2) const;
2397   static inline isl::multi_pw_aff zero(isl::space space);
2398 };
2399 
2400 // declarations for isl::multi_union_pw_aff
2401 inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2402 inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2403 
2404 class multi_union_pw_aff {
2405   friend inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2406   friend inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2407 
2408 protected:
2409   isl_multi_union_pw_aff *ptr = nullptr;
2410 
2411   inline explicit multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr);
2412 
2413 public:
2414   inline /* implicit */ multi_union_pw_aff();
2415   inline /* implicit */ multi_union_pw_aff(const multi_union_pw_aff &obj);
2416   inline /* implicit */ multi_union_pw_aff(isl::multi_pw_aff mpa);
2417   inline /* implicit */ multi_union_pw_aff(isl::union_pw_aff upa);
2418   inline explicit multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list);
2419   inline explicit multi_union_pw_aff(isl::ctx ctx, const std::string &str);
2420   inline multi_union_pw_aff &operator=(multi_union_pw_aff obj);
2421   inline ~multi_union_pw_aff();
2422   inline __isl_give isl_multi_union_pw_aff *copy() const &;
2423   inline __isl_give isl_multi_union_pw_aff *copy() && = delete;
2424   inline __isl_keep isl_multi_union_pw_aff *get() const;
2425   inline __isl_give isl_multi_union_pw_aff *release();
2426   inline bool is_null() const;
2427   inline isl::ctx ctx() const;
2428 
2429   inline isl::multi_union_pw_aff add(isl::multi_union_pw_aff multi2) const;
2430   inline isl::union_pw_aff at(int pos) const;
2431   inline isl::union_pw_aff get_at(int pos) const;
2432   inline isl::union_set bind(isl::multi_id tuple) const;
2433   inline isl::multi_union_pw_aff coalesce() const;
2434   inline isl::union_set domain() const;
2435   inline isl::multi_union_pw_aff flat_range_product(isl::multi_union_pw_aff multi2) const;
2436   inline isl::multi_union_pw_aff gist(isl::union_set context) const;
2437   inline bool has_range_tuple_id() const;
2438   inline isl::multi_union_pw_aff intersect_domain(isl::union_set uset) const;
2439   inline isl::multi_union_pw_aff intersect_params(isl::set params) const;
2440   inline bool involves_nan() const;
2441   inline isl::union_pw_aff_list list() const;
2442   inline isl::union_pw_aff_list get_list() const;
2443   inline isl::multi_union_pw_aff neg() const;
2444   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2445   inline isl::multi_union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
2446   inline isl::multi_union_pw_aff range_product(isl::multi_union_pw_aff multi2) const;
2447   inline isl::id range_tuple_id() const;
2448   inline isl::id get_range_tuple_id() const;
2449   inline isl::multi_union_pw_aff reset_range_tuple_id() const;
2450   inline isl::multi_union_pw_aff scale(isl::multi_val mv) const;
2451   inline isl::multi_union_pw_aff scale(isl::val v) const;
2452   inline isl::multi_union_pw_aff scale(long v) const;
2453   inline isl::multi_union_pw_aff scale_down(isl::multi_val mv) const;
2454   inline isl::multi_union_pw_aff scale_down(isl::val v) const;
2455   inline isl::multi_union_pw_aff scale_down(long v) const;
2456   inline isl::multi_union_pw_aff set_at(int pos, isl::union_pw_aff el) const;
2457   inline isl::multi_union_pw_aff set_range_tuple(isl::id id) const;
2458   inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
2459   inline unsigned size() const;
2460   inline isl::space space() const;
2461   inline isl::space get_space() const;
2462   inline isl::multi_union_pw_aff sub(isl::multi_union_pw_aff multi2) const;
2463   inline isl::multi_union_pw_aff union_add(isl::multi_union_pw_aff mupa2) const;
2464   static inline isl::multi_union_pw_aff zero(isl::space space);
2465 };
2466 
2467 // declarations for isl::multi_val
2468 inline multi_val manage(__isl_take isl_multi_val *ptr);
2469 inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2470 
2471 class multi_val {
2472   friend inline multi_val manage(__isl_take isl_multi_val *ptr);
2473   friend inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2474 
2475 protected:
2476   isl_multi_val *ptr = nullptr;
2477 
2478   inline explicit multi_val(__isl_take isl_multi_val *ptr);
2479 
2480 public:
2481   inline /* implicit */ multi_val();
2482   inline /* implicit */ multi_val(const multi_val &obj);
2483   inline explicit multi_val(isl::space space, isl::val_list list);
2484   inline explicit multi_val(isl::ctx ctx, const std::string &str);
2485   inline multi_val &operator=(multi_val obj);
2486   inline ~multi_val();
2487   inline __isl_give isl_multi_val *copy() const &;
2488   inline __isl_give isl_multi_val *copy() && = delete;
2489   inline __isl_keep isl_multi_val *get() const;
2490   inline __isl_give isl_multi_val *release();
2491   inline bool is_null() const;
2492   inline isl::ctx ctx() const;
2493 
2494   inline isl::multi_val add(isl::multi_val multi2) const;
2495   inline isl::multi_val add(isl::val v) const;
2496   inline isl::multi_val add(long v) const;
2497   inline isl::val at(int pos) const;
2498   inline isl::val get_at(int pos) const;
2499   inline isl::multi_val flat_range_product(isl::multi_val multi2) const;
2500   inline bool has_range_tuple_id() const;
2501   inline bool involves_nan() const;
2502   inline isl::val_list list() const;
2503   inline isl::val_list get_list() const;
2504   inline isl::multi_val max(isl::multi_val multi2) const;
2505   inline isl::multi_val min(isl::multi_val multi2) const;
2506   inline isl::multi_val neg() const;
2507   inline bool plain_is_equal(const isl::multi_val &multi2) const;
2508   inline isl::multi_val product(isl::multi_val multi2) const;
2509   inline isl::multi_val range_product(isl::multi_val multi2) const;
2510   inline isl::id range_tuple_id() const;
2511   inline isl::id get_range_tuple_id() const;
2512   inline isl::multi_val reset_range_tuple_id() const;
2513   inline isl::multi_val scale(isl::multi_val mv) const;
2514   inline isl::multi_val scale(isl::val v) const;
2515   inline isl::multi_val scale(long v) const;
2516   inline isl::multi_val scale_down(isl::multi_val mv) const;
2517   inline isl::multi_val scale_down(isl::val v) const;
2518   inline isl::multi_val scale_down(long v) const;
2519   inline isl::multi_val set_at(int pos, isl::val el) const;
2520   inline isl::multi_val set_at(int pos, long el) const;
2521   inline isl::multi_val set_range_tuple(isl::id id) const;
2522   inline isl::multi_val set_range_tuple(const std::string &id) const;
2523   inline unsigned size() const;
2524   inline isl::space space() const;
2525   inline isl::space get_space() const;
2526   inline isl::multi_val sub(isl::multi_val multi2) const;
2527   static inline isl::multi_val zero(isl::space space);
2528 };
2529 
2530 // declarations for isl::point
2531 inline point manage(__isl_take isl_point *ptr);
2532 inline point manage_copy(__isl_keep isl_point *ptr);
2533 
2534 class point {
2535   friend inline point manage(__isl_take isl_point *ptr);
2536   friend inline point manage_copy(__isl_keep isl_point *ptr);
2537 
2538 protected:
2539   isl_point *ptr = nullptr;
2540 
2541   inline explicit point(__isl_take isl_point *ptr);
2542 
2543 public:
2544   inline /* implicit */ point();
2545   inline /* implicit */ point(const point &obj);
2546   inline point &operator=(point obj);
2547   inline ~point();
2548   inline __isl_give isl_point *copy() const &;
2549   inline __isl_give isl_point *copy() && = delete;
2550   inline __isl_keep isl_point *get() const;
2551   inline __isl_give isl_point *release();
2552   inline bool is_null() const;
2553   inline isl::ctx ctx() const;
2554 
2555   inline isl::basic_set affine_hull() const;
2556   inline isl::basic_set apply(const isl::basic_map &bmap) const;
2557   inline isl::set apply(const isl::map &map) const;
2558   inline isl::union_set apply(const isl::union_map &umap) const;
2559   inline isl::pw_multi_aff as_pw_multi_aff() const;
2560   inline isl::set as_set() const;
2561   inline isl::set bind(const isl::multi_id &tuple) const;
2562   inline isl::set coalesce() const;
2563   inline isl::set complement() const;
2564   inline isl::union_set compute_divs() const;
2565   inline isl::basic_set detect_equalities() const;
2566   inline isl::val dim_max_val(int pos) const;
2567   inline isl::val dim_min_val(int pos) const;
2568   inline bool every_set(const std::function<bool(isl::set)> &test) const;
2569   inline isl::set extract_set(const isl::space &space) const;
2570   inline isl::basic_set flatten() const;
2571   inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
2572   inline void foreach_point(const std::function<void(isl::point)> &fn) const;
2573   inline void foreach_set(const std::function<void(isl::set)> &fn) const;
2574   inline isl::basic_set gist(const isl::basic_set &context) const;
2575   inline isl::set gist(const isl::set &context) const;
2576   inline isl::union_set gist(const isl::union_set &context) const;
2577   inline isl::union_set gist_params(const isl::set &set) const;
2578   inline isl::map identity() const;
2579   inline isl::pw_aff indicator_function() const;
2580   inline isl::map insert_domain(const isl::space &domain) const;
2581   inline isl::basic_set intersect(const isl::basic_set &bset2) const;
2582   inline isl::set intersect(const isl::set &set2) const;
2583   inline isl::union_set intersect(const isl::union_set &uset2) const;
2584   inline isl::basic_set intersect_params(const isl::basic_set &bset2) const;
2585   inline isl::set intersect_params(const isl::set &params) const;
2586   inline bool involves_locals() const;
2587   inline bool is_disjoint(const isl::set &set2) const;
2588   inline bool is_disjoint(const isl::union_set &uset2) const;
2589   inline bool is_empty() const;
2590   inline bool is_equal(const isl::basic_set &bset2) const;
2591   inline bool is_equal(const isl::set &set2) const;
2592   inline bool is_equal(const isl::union_set &uset2) const;
2593   inline bool is_singleton() const;
2594   inline bool is_strict_subset(const isl::set &set2) const;
2595   inline bool is_strict_subset(const isl::union_set &uset2) const;
2596   inline bool is_subset(const isl::basic_set &bset2) const;
2597   inline bool is_subset(const isl::set &set2) const;
2598   inline bool is_subset(const isl::union_set &uset2) const;
2599   inline bool is_wrapping() const;
2600   inline bool isa_set() const;
2601   inline isl::set lexmax() const;
2602   inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
2603   inline isl::set lexmin() const;
2604   inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
2605   inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
2606   inline isl::set lower_bound(const isl::multi_val &lower) const;
2607   inline isl::multi_pw_aff max_multi_pw_aff() const;
2608   inline isl::val max_val(const isl::aff &obj) const;
2609   inline isl::multi_pw_aff min_multi_pw_aff() const;
2610   inline isl::val min_val(const isl::aff &obj) const;
2611   inline isl::multi_val multi_val() const;
2612   inline isl::multi_val get_multi_val() const;
2613   inline unsigned n_basic_set() const;
2614   inline isl::basic_set params() const;
2615   inline isl::multi_val plain_multi_val_if_fixed() const;
2616   inline isl::basic_set polyhedral_hull() const;
2617   inline isl::set preimage(const isl::multi_aff &ma) const;
2618   inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
2619   inline isl::set preimage(const isl::pw_multi_aff &pma) const;
2620   inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
2621   inline isl::set product(const isl::set &set2) const;
2622   inline isl::set project_out_all_params() const;
2623   inline isl::set project_out_param(const isl::id &id) const;
2624   inline isl::set project_out_param(const std::string &id) const;
2625   inline isl::set project_out_param(const isl::id_list &list) const;
2626   inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
2627   inline isl::basic_set sample() const;
2628   inline isl::point sample_point() const;
2629   inline isl::set_list set_list() const;
2630   inline isl::fixed_box simple_fixed_box_hull() const;
2631   inline isl::space space() const;
2632   inline isl::val stride(int pos) const;
2633   inline isl::set subtract(const isl::set &set2) const;
2634   inline isl::union_set subtract(const isl::union_set &uset2) const;
2635   inline isl::set_list to_list() const;
2636   inline isl::set to_set() const;
2637   inline isl::union_set to_union_set() const;
2638   inline isl::map translation() const;
2639   inline unsigned tuple_dim() const;
2640   inline isl::set unbind_params(const isl::multi_id &tuple) const;
2641   inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
2642   inline isl::set unite(const isl::basic_set &bset2) const;
2643   inline isl::set unite(const isl::set &set2) const;
2644   inline isl::union_set unite(const isl::union_set &uset2) const;
2645   inline isl::basic_set unshifted_simple_hull() const;
2646   inline isl::map unwrap() const;
2647   inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
2648   inline isl::set upper_bound(const isl::multi_val &upper) const;
2649 };
2650 
2651 // declarations for isl::pw_aff
2652 inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2653 inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2654 
2655 class pw_aff {
2656   friend inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2657   friend inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2658 
2659 protected:
2660   isl_pw_aff *ptr = nullptr;
2661 
2662   inline explicit pw_aff(__isl_take isl_pw_aff *ptr);
2663 
2664 public:
2665   inline /* implicit */ pw_aff();
2666   inline /* implicit */ pw_aff(const pw_aff &obj);
2667   inline /* implicit */ pw_aff(isl::aff aff);
2668   inline explicit pw_aff(isl::ctx ctx, const std::string &str);
2669   inline pw_aff &operator=(pw_aff obj);
2670   inline ~pw_aff();
2671   inline __isl_give isl_pw_aff *copy() const &;
2672   inline __isl_give isl_pw_aff *copy() && = delete;
2673   inline __isl_keep isl_pw_aff *get() const;
2674   inline __isl_give isl_pw_aff *release();
2675   inline bool is_null() const;
2676   inline isl::ctx ctx() const;
2677 
2678   inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2679   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2680   inline isl::pw_aff add(isl::pw_aff pwaff2) const;
2681   inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2682   inline isl::union_pw_aff add(const isl::union_pw_aff &upa2) const;
2683   inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2684   inline isl::pw_aff add(const isl::aff &pwaff2) const;
2685   inline isl::pw_aff add_constant(isl::val v) const;
2686   inline isl::pw_aff add_constant(long v) const;
2687   inline isl::pw_multi_aff add_constant(const isl::multi_val &mv) const;
2688   inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2689   inline isl::aff as_aff() const;
2690   inline isl::map as_map() const;
2691   inline isl::multi_aff as_multi_aff() const;
2692   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2693   inline isl::pw_multi_aff as_pw_multi_aff() const;
2694   inline isl::set as_set() const;
2695   inline isl::union_map as_union_map() const;
2696   inline isl::pw_aff at(int pos) const;
2697   inline isl::set bind(const isl::multi_id &tuple) const;
2698   inline isl::set bind(isl::id id) const;
2699   inline isl::set bind(const std::string &id) const;
2700   inline isl::pw_aff bind_domain(isl::multi_id tuple) const;
2701   inline isl::pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2702   inline isl::pw_aff ceil() const;
2703   inline isl::pw_aff coalesce() const;
2704   inline isl::pw_aff cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const;
2705   inline isl::pw_aff div(isl::pw_aff pa2) const;
2706   inline isl::set domain() const;
2707   inline isl::set eq_set(isl::pw_aff pwaff2) const;
2708   inline isl::val eval(isl::point pnt) const;
2709   inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2710   inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2711   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2712   inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2713   inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2714   inline isl::pw_aff floor() const;
2715   inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2716   inline isl::set ge_set(isl::pw_aff pwaff2) const;
2717   inline isl::pw_aff gist(isl::set context) const;
2718   inline isl::union_pw_aff gist(const isl::union_set &context) const;
2719   inline isl::pw_aff gist(const isl::basic_set &context) const;
2720   inline isl::pw_aff gist(const isl::point &context) const;
2721   inline isl::set gt_set(isl::pw_aff pwaff2) const;
2722   inline bool has_range_tuple_id() const;
2723   inline isl::multi_pw_aff identity() const;
2724   inline isl::pw_aff insert_domain(isl::space domain) const;
2725   inline isl::pw_aff intersect_domain(isl::set set) const;
2726   inline isl::union_pw_aff intersect_domain(const isl::space &space) const;
2727   inline isl::union_pw_aff intersect_domain(const isl::union_set &uset) const;
2728   inline isl::pw_aff intersect_domain(const isl::basic_set &set) const;
2729   inline isl::pw_aff intersect_domain(const isl::point &set) const;
2730   inline isl::union_pw_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2731   inline isl::union_pw_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2732   inline isl::pw_aff intersect_params(isl::set set) const;
2733   inline bool involves_locals() const;
2734   inline bool involves_nan() const;
2735   inline bool involves_param(const isl::id &id) const;
2736   inline bool involves_param(const std::string &id) const;
2737   inline bool involves_param(const isl::id_list &list) const;
2738   inline bool isa_aff() const;
2739   inline bool isa_multi_aff() const;
2740   inline bool isa_pw_multi_aff() const;
2741   inline isl::set le_set(isl::pw_aff pwaff2) const;
2742   inline isl::pw_aff_list list() const;
2743   inline isl::set lt_set(isl::pw_aff pwaff2) const;
2744   inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2745   inline isl::pw_aff max(isl::pw_aff pwaff2) const;
2746   inline isl::pw_aff max(const isl::aff &pwaff2) const;
2747   inline isl::multi_val max_multi_val() const;
2748   inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2749   inline isl::pw_aff min(isl::pw_aff pwaff2) const;
2750   inline isl::pw_aff min(const isl::aff &pwaff2) const;
2751   inline isl::multi_val min_multi_val() const;
2752   inline isl::pw_aff mod(isl::val mod) const;
2753   inline isl::pw_aff mod(long mod) const;
2754   inline isl::pw_aff mul(isl::pw_aff pwaff2) const;
2755   inline unsigned n_piece() const;
2756   inline isl::set ne_set(isl::pw_aff pwaff2) const;
2757   inline isl::pw_aff neg() const;
2758   static inline isl::pw_aff param_on_domain(isl::set domain, isl::id id);
2759   inline bool plain_is_empty() const;
2760   inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2761   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2762   inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2763   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2764   inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2765   inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2766   inline isl::pw_aff pullback(isl::multi_aff ma) const;
2767   inline isl::pw_aff pullback(isl::multi_pw_aff mpa) const;
2768   inline isl::pw_aff pullback(isl::pw_multi_aff pma) const;
2769   inline isl::union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2770   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2771   inline isl::pw_multi_aff range_factor_domain() const;
2772   inline isl::pw_multi_aff range_factor_range() const;
2773   inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2774   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2775   inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2776   inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2777   inline isl::id range_tuple_id() const;
2778   inline isl::multi_pw_aff reset_range_tuple_id() const;
2779   inline isl::multi_pw_aff scale(const isl::multi_val &mv) const;
2780   inline isl::pw_aff scale(isl::val v) const;
2781   inline isl::pw_aff scale(long v) const;
2782   inline isl::multi_pw_aff scale_down(const isl::multi_val &mv) const;
2783   inline isl::pw_aff scale_down(isl::val f) const;
2784   inline isl::pw_aff scale_down(long f) const;
2785   inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2786   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2787   inline isl::pw_multi_aff set_range_tuple(const isl::id &id) const;
2788   inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
2789   inline unsigned size() const;
2790   inline isl::space space() const;
2791   inline isl::space get_space() const;
2792   inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2793   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2794   inline isl::pw_aff sub(isl::pw_aff pwaff2) const;
2795   inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2796   inline isl::union_pw_aff sub(const isl::union_pw_aff &upa2) const;
2797   inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2798   inline isl::pw_aff sub(const isl::aff &pwaff2) const;
2799   inline isl::pw_aff subtract_domain(isl::set set) const;
2800   inline isl::union_pw_aff subtract_domain(const isl::space &space) const;
2801   inline isl::union_pw_aff subtract_domain(const isl::union_set &uset) const;
2802   inline isl::pw_aff subtract_domain(const isl::basic_set &set) const;
2803   inline isl::pw_aff subtract_domain(const isl::point &set) const;
2804   inline isl::pw_aff tdiv_q(isl::pw_aff pa2) const;
2805   inline isl::pw_aff tdiv_r(isl::pw_aff pa2) const;
2806   inline isl::pw_aff_list to_list() const;
2807   inline isl::multi_pw_aff to_multi_pw_aff() const;
2808   inline isl::union_pw_aff to_union_pw_aff() const;
2809   inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2810   inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
2811   inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2812   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2813   inline isl::pw_aff union_add(isl::pw_aff pwaff2) const;
2814   inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2815   inline isl::union_pw_aff union_add(const isl::union_pw_aff &upa2) const;
2816   inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2817   inline isl::pw_aff union_add(const isl::aff &pwaff2) const;
2818 };
2819 
2820 // declarations for isl::pw_aff_list
2821 inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2822 inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2823 
2824 class pw_aff_list {
2825   friend inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2826   friend inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2827 
2828 protected:
2829   isl_pw_aff_list *ptr = nullptr;
2830 
2831   inline explicit pw_aff_list(__isl_take isl_pw_aff_list *ptr);
2832 
2833 public:
2834   inline /* implicit */ pw_aff_list();
2835   inline /* implicit */ pw_aff_list(const pw_aff_list &obj);
2836   inline explicit pw_aff_list(isl::ctx ctx, int n);
2837   inline explicit pw_aff_list(isl::pw_aff el);
2838   inline explicit pw_aff_list(isl::ctx ctx, const std::string &str);
2839   inline pw_aff_list &operator=(pw_aff_list obj);
2840   inline ~pw_aff_list();
2841   inline __isl_give isl_pw_aff_list *copy() const &;
2842   inline __isl_give isl_pw_aff_list *copy() && = delete;
2843   inline __isl_keep isl_pw_aff_list *get() const;
2844   inline __isl_give isl_pw_aff_list *release();
2845   inline bool is_null() const;
2846   inline isl::ctx ctx() const;
2847 
2848   inline isl::pw_aff_list add(isl::pw_aff el) const;
2849   inline isl::pw_aff at(int index) const;
2850   inline isl::pw_aff get_at(int index) const;
2851   inline isl::pw_aff_list clear() const;
2852   inline isl::pw_aff_list concat(isl::pw_aff_list list2) const;
2853   inline isl::pw_aff_list drop(unsigned int first, unsigned int n) const;
2854   inline void foreach(const std::function<void(isl::pw_aff)> &fn) const;
2855   inline isl::pw_aff_list insert(unsigned int pos, isl::pw_aff el) const;
2856   inline unsigned size() const;
2857 };
2858 
2859 // declarations for isl::pw_multi_aff
2860 inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
2861 inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
2862 
2863 class pw_multi_aff {
2864   friend inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
2865   friend inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
2866 
2867 protected:
2868   isl_pw_multi_aff *ptr = nullptr;
2869 
2870   inline explicit pw_multi_aff(__isl_take isl_pw_multi_aff *ptr);
2871 
2872 public:
2873   inline /* implicit */ pw_multi_aff();
2874   inline /* implicit */ pw_multi_aff(const pw_multi_aff &obj);
2875   inline /* implicit */ pw_multi_aff(isl::multi_aff ma);
2876   inline /* implicit */ pw_multi_aff(isl::pw_aff pa);
2877   inline explicit pw_multi_aff(isl::ctx ctx, const std::string &str);
2878   inline pw_multi_aff &operator=(pw_multi_aff obj);
2879   inline ~pw_multi_aff();
2880   inline __isl_give isl_pw_multi_aff *copy() const &;
2881   inline __isl_give isl_pw_multi_aff *copy() && = delete;
2882   inline __isl_keep isl_pw_multi_aff *get() const;
2883   inline __isl_give isl_pw_multi_aff *release();
2884   inline bool is_null() const;
2885   inline isl::ctx ctx() const;
2886 
2887   inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2888   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2889   inline isl::pw_multi_aff add(isl::pw_multi_aff pma2) const;
2890   inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2891   inline isl::pw_multi_aff add(const isl::multi_aff &pma2) const;
2892   inline isl::pw_multi_aff add(const isl::pw_aff &pma2) const;
2893   inline isl::pw_multi_aff add_constant(isl::multi_val mv) const;
2894   inline isl::pw_multi_aff add_constant(isl::val v) const;
2895   inline isl::pw_multi_aff add_constant(long v) const;
2896   inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2897   inline isl::map as_map() const;
2898   inline isl::multi_aff as_multi_aff() const;
2899   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2900   inline isl::pw_multi_aff as_pw_multi_aff() const;
2901   inline isl::set as_set() const;
2902   inline isl::union_map as_union_map() const;
2903   inline isl::pw_aff at(int pos) const;
2904   inline isl::pw_aff get_at(int pos) const;
2905   inline isl::set bind(const isl::multi_id &tuple) const;
2906   inline isl::pw_multi_aff bind_domain(isl::multi_id tuple) const;
2907   inline isl::pw_multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2908   inline isl::pw_multi_aff coalesce() const;
2909   inline isl::set domain() const;
2910   static inline isl::pw_multi_aff domain_map(isl::space space);
2911   inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2912   inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2913   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2914   inline isl::pw_multi_aff flat_range_product(isl::pw_multi_aff pma2) const;
2915   inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2916   inline isl::pw_multi_aff flat_range_product(const isl::multi_aff &pma2) const;
2917   inline isl::pw_multi_aff flat_range_product(const isl::pw_aff &pma2) const;
2918   inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2919   inline isl::pw_multi_aff gist(isl::set set) const;
2920   inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
2921   inline isl::pw_multi_aff gist(const isl::basic_set &set) const;
2922   inline isl::pw_multi_aff gist(const isl::point &set) const;
2923   inline bool has_range_tuple_id() const;
2924   inline isl::multi_pw_aff identity() const;
2925   static inline isl::pw_multi_aff identity_on_domain(isl::space space);
2926   inline isl::pw_multi_aff insert_domain(isl::space domain) const;
2927   inline isl::pw_multi_aff intersect_domain(isl::set set) const;
2928   inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
2929   inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
2930   inline isl::pw_multi_aff intersect_domain(const isl::basic_set &set) const;
2931   inline isl::pw_multi_aff intersect_domain(const isl::point &set) const;
2932   inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2933   inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2934   inline isl::pw_multi_aff intersect_params(isl::set set) const;
2935   inline bool involves_locals() const;
2936   inline bool involves_nan() const;
2937   inline bool involves_param(const isl::id &id) const;
2938   inline bool involves_param(const std::string &id) const;
2939   inline bool involves_param(const isl::id_list &list) const;
2940   inline bool isa_multi_aff() const;
2941   inline bool isa_pw_multi_aff() const;
2942   inline isl::pw_aff_list list() const;
2943   inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2944   inline isl::multi_val max_multi_val() const;
2945   inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2946   inline isl::multi_val min_multi_val() const;
2947   static inline isl::pw_multi_aff multi_val_on_domain(isl::set domain, isl::multi_val mv);
2948   inline unsigned n_piece() const;
2949   inline isl::multi_pw_aff neg() const;
2950   inline bool plain_is_empty() const;
2951   inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2952   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2953   inline isl::pw_multi_aff preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const;
2954   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2955   inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const;
2956   inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const;
2957   inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2958   inline isl::pw_multi_aff product(isl::pw_multi_aff pma2) const;
2959   inline isl::pw_multi_aff product(const isl::multi_aff &pma2) const;
2960   inline isl::pw_multi_aff product(const isl::pw_aff &pma2) const;
2961   inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
2962   inline isl::pw_multi_aff pullback(isl::multi_aff ma) const;
2963   inline isl::pw_multi_aff pullback(isl::pw_multi_aff pma2) const;
2964   inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
2965   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2966   inline isl::pw_multi_aff range_factor_domain() const;
2967   inline isl::pw_multi_aff range_factor_range() const;
2968   static inline isl::pw_multi_aff range_map(isl::space space);
2969   inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2970   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2971   inline isl::pw_multi_aff range_product(isl::pw_multi_aff pma2) const;
2972   inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2973   inline isl::pw_multi_aff range_product(const isl::multi_aff &pma2) const;
2974   inline isl::pw_multi_aff range_product(const isl::pw_aff &pma2) const;
2975   inline isl::id range_tuple_id() const;
2976   inline isl::id get_range_tuple_id() const;
2977   inline isl::multi_pw_aff reset_range_tuple_id() const;
2978   inline isl::multi_pw_aff scale(const isl::multi_val &mv) const;
2979   inline isl::pw_multi_aff scale(isl::val v) const;
2980   inline isl::pw_multi_aff scale(long v) const;
2981   inline isl::multi_pw_aff scale_down(const isl::multi_val &mv) const;
2982   inline isl::pw_multi_aff scale_down(isl::val v) const;
2983   inline isl::pw_multi_aff scale_down(long v) const;
2984   inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2985   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2986   inline isl::pw_multi_aff set_range_tuple(isl::id id) const;
2987   inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
2988   inline unsigned size() const;
2989   inline isl::space space() const;
2990   inline isl::space get_space() const;
2991   inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2992   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2993   inline isl::pw_multi_aff sub(isl::pw_multi_aff pma2) const;
2994   inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2995   inline isl::pw_multi_aff sub(const isl::multi_aff &pma2) const;
2996   inline isl::pw_multi_aff sub(const isl::pw_aff &pma2) const;
2997   inline isl::pw_multi_aff subtract_domain(isl::set set) const;
2998   inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
2999   inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
3000   inline isl::pw_multi_aff subtract_domain(const isl::basic_set &set) const;
3001   inline isl::pw_multi_aff subtract_domain(const isl::point &set) const;
3002   inline isl::pw_multi_aff_list to_list() const;
3003   inline isl::multi_pw_aff to_multi_pw_aff() const;
3004   inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
3005   inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
3006   inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
3007   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
3008   inline isl::pw_multi_aff union_add(isl::pw_multi_aff pma2) const;
3009   inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
3010   inline isl::pw_multi_aff union_add(const isl::multi_aff &pma2) const;
3011   inline isl::pw_multi_aff union_add(const isl::pw_aff &pma2) const;
3012   static inline isl::pw_multi_aff zero(isl::space space);
3013 };
3014 
3015 // declarations for isl::pw_multi_aff_list
3016 inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3017 inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3018 
3019 class pw_multi_aff_list {
3020   friend inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3021   friend inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3022 
3023 protected:
3024   isl_pw_multi_aff_list *ptr = nullptr;
3025 
3026   inline explicit pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr);
3027 
3028 public:
3029   inline /* implicit */ pw_multi_aff_list();
3030   inline /* implicit */ pw_multi_aff_list(const pw_multi_aff_list &obj);
3031   inline explicit pw_multi_aff_list(isl::ctx ctx, int n);
3032   inline explicit pw_multi_aff_list(isl::pw_multi_aff el);
3033   inline explicit pw_multi_aff_list(isl::ctx ctx, const std::string &str);
3034   inline pw_multi_aff_list &operator=(pw_multi_aff_list obj);
3035   inline ~pw_multi_aff_list();
3036   inline __isl_give isl_pw_multi_aff_list *copy() const &;
3037   inline __isl_give isl_pw_multi_aff_list *copy() && = delete;
3038   inline __isl_keep isl_pw_multi_aff_list *get() const;
3039   inline __isl_give isl_pw_multi_aff_list *release();
3040   inline bool is_null() const;
3041   inline isl::ctx ctx() const;
3042 
3043   inline isl::pw_multi_aff_list add(isl::pw_multi_aff el) const;
3044   inline isl::pw_multi_aff at(int index) const;
3045   inline isl::pw_multi_aff get_at(int index) const;
3046   inline isl::pw_multi_aff_list clear() const;
3047   inline isl::pw_multi_aff_list concat(isl::pw_multi_aff_list list2) const;
3048   inline isl::pw_multi_aff_list drop(unsigned int first, unsigned int n) const;
3049   inline void foreach(const std::function<void(isl::pw_multi_aff)> &fn) const;
3050   inline isl::pw_multi_aff_list insert(unsigned int pos, isl::pw_multi_aff el) const;
3051   inline unsigned size() const;
3052 };
3053 
3054 // declarations for isl::schedule
3055 inline schedule manage(__isl_take isl_schedule *ptr);
3056 inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3057 
3058 class schedule {
3059   friend inline schedule manage(__isl_take isl_schedule *ptr);
3060   friend inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3061 
3062 protected:
3063   isl_schedule *ptr = nullptr;
3064 
3065   inline explicit schedule(__isl_take isl_schedule *ptr);
3066 
3067 public:
3068   inline /* implicit */ schedule();
3069   inline /* implicit */ schedule(const schedule &obj);
3070   inline explicit schedule(isl::ctx ctx, const std::string &str);
3071   inline schedule &operator=(schedule obj);
3072   inline ~schedule();
3073   inline __isl_give isl_schedule *copy() const &;
3074   inline __isl_give isl_schedule *copy() && = delete;
3075   inline __isl_keep isl_schedule *get() const;
3076   inline __isl_give isl_schedule *release();
3077   inline bool is_null() const;
3078   inline isl::ctx ctx() const;
3079 
3080   inline isl::union_set domain() const;
3081   inline isl::union_set get_domain() const;
3082   static inline isl::schedule from_domain(isl::union_set domain);
3083   inline isl::union_map map() const;
3084   inline isl::union_map get_map() const;
3085   inline isl::schedule pullback(isl::union_pw_multi_aff upma) const;
3086   inline isl::schedule_node root() const;
3087   inline isl::schedule_node get_root() const;
3088 };
3089 
3090 // declarations for isl::schedule_constraints
3091 inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3092 inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3093 
3094 class schedule_constraints {
3095   friend inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3096   friend inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3097 
3098 protected:
3099   isl_schedule_constraints *ptr = nullptr;
3100 
3101   inline explicit schedule_constraints(__isl_take isl_schedule_constraints *ptr);
3102 
3103 public:
3104   inline /* implicit */ schedule_constraints();
3105   inline /* implicit */ schedule_constraints(const schedule_constraints &obj);
3106   inline explicit schedule_constraints(isl::ctx ctx, const std::string &str);
3107   inline schedule_constraints &operator=(schedule_constraints obj);
3108   inline ~schedule_constraints();
3109   inline __isl_give isl_schedule_constraints *copy() const &;
3110   inline __isl_give isl_schedule_constraints *copy() && = delete;
3111   inline __isl_keep isl_schedule_constraints *get() const;
3112   inline __isl_give isl_schedule_constraints *release();
3113   inline bool is_null() const;
3114   inline isl::ctx ctx() const;
3115 
3116   inline isl::union_map coincidence() const;
3117   inline isl::union_map get_coincidence() const;
3118   inline isl::schedule compute_schedule() const;
3119   inline isl::union_map conditional_validity() const;
3120   inline isl::union_map get_conditional_validity() const;
3121   inline isl::union_map conditional_validity_condition() const;
3122   inline isl::union_map get_conditional_validity_condition() const;
3123   inline isl::set context() const;
3124   inline isl::set get_context() const;
3125   inline isl::union_set domain() const;
3126   inline isl::union_set get_domain() const;
3127   static inline isl::schedule_constraints on_domain(isl::union_set domain);
3128   inline isl::union_map proximity() const;
3129   inline isl::union_map get_proximity() const;
3130   inline isl::schedule_constraints set_coincidence(isl::union_map coincidence) const;
3131   inline isl::schedule_constraints set_conditional_validity(isl::union_map condition, isl::union_map validity) const;
3132   inline isl::schedule_constraints set_context(isl::set context) const;
3133   inline isl::schedule_constraints set_proximity(isl::union_map proximity) const;
3134   inline isl::schedule_constraints set_validity(isl::union_map validity) const;
3135   inline isl::union_map validity() const;
3136   inline isl::union_map get_validity() const;
3137 };
3138 
3139 // declarations for isl::schedule_node
3140 inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3141 inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3142 
3143 class schedule_node {
3144   friend inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3145   friend inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3146 
3147 protected:
3148   isl_schedule_node *ptr = nullptr;
3149 
3150   inline explicit schedule_node(__isl_take isl_schedule_node *ptr);
3151 
3152 public:
3153   inline /* implicit */ schedule_node();
3154   inline /* implicit */ schedule_node(const schedule_node &obj);
3155   inline schedule_node &operator=(schedule_node obj);
3156   inline ~schedule_node();
3157   inline __isl_give isl_schedule_node *copy() const &;
3158   inline __isl_give isl_schedule_node *copy() && = delete;
3159   inline __isl_keep isl_schedule_node *get() const;
3160   inline __isl_give isl_schedule_node *release();
3161   inline bool is_null() const;
3162 private:
3163   template <typename T,
3164           typename = typename std::enable_if<std::is_same<
3165                   const decltype(isl_schedule_node_get_type(NULL)),
3166                   const T>::value>::type>
3167   inline bool isa_type(T subtype) const;
3168 public:
3169   template <class T> inline bool isa() const;
3170   template <class T> inline T as() const;
3171   inline isl::ctx ctx() const;
3172 
3173   inline isl::schedule_node ancestor(int generation) const;
3174   inline unsigned ancestor_child_position(const isl::schedule_node &ancestor) const;
3175   inline unsigned get_ancestor_child_position(const isl::schedule_node &ancestor) const;
3176   inline isl::schedule_node child(int pos) const;
3177   inline unsigned child_position() const;
3178   inline unsigned get_child_position() const;
3179   inline bool every_descendant(const std::function<bool(isl::schedule_node)> &test) const;
3180   inline isl::schedule_node first_child() const;
3181   inline void foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const;
3182   inline void foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const;
3183   static inline isl::schedule_node from_domain(isl::union_set domain);
3184   static inline isl::schedule_node from_extension(isl::union_map extension);
3185   inline isl::schedule_node graft_after(isl::schedule_node graft) const;
3186   inline isl::schedule_node graft_before(isl::schedule_node graft) const;
3187   inline bool has_children() const;
3188   inline bool has_next_sibling() const;
3189   inline bool has_parent() const;
3190   inline bool has_previous_sibling() const;
3191   inline isl::schedule_node insert_context(isl::set context) const;
3192   inline isl::schedule_node insert_filter(isl::union_set filter) const;
3193   inline isl::schedule_node insert_guard(isl::set context) const;
3194   inline isl::schedule_node insert_mark(isl::id mark) const;
3195   inline isl::schedule_node insert_mark(const std::string &mark) const;
3196   inline isl::schedule_node insert_partial_schedule(isl::multi_union_pw_aff schedule) const;
3197   inline isl::schedule_node insert_sequence(isl::union_set_list filters) const;
3198   inline isl::schedule_node insert_set(isl::union_set_list filters) const;
3199   inline bool is_equal(const isl::schedule_node &node2) const;
3200   inline bool is_subtree_anchored() const;
3201   inline isl::schedule_node map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const;
3202   inline unsigned n_children() const;
3203   inline isl::schedule_node next_sibling() const;
3204   inline isl::schedule_node order_after(isl::union_set filter) const;
3205   inline isl::schedule_node order_before(isl::union_set filter) const;
3206   inline isl::schedule_node parent() const;
3207   inline isl::multi_union_pw_aff prefix_schedule_multi_union_pw_aff() const;
3208   inline isl::multi_union_pw_aff get_prefix_schedule_multi_union_pw_aff() const;
3209   inline isl::union_map prefix_schedule_union_map() const;
3210   inline isl::union_map get_prefix_schedule_union_map() const;
3211   inline isl::union_pw_multi_aff prefix_schedule_union_pw_multi_aff() const;
3212   inline isl::union_pw_multi_aff get_prefix_schedule_union_pw_multi_aff() const;
3213   inline isl::schedule_node previous_sibling() const;
3214   inline isl::schedule_node root() const;
3215   inline isl::schedule schedule() const;
3216   inline isl::schedule get_schedule() const;
3217   inline isl::schedule_node shared_ancestor(const isl::schedule_node &node2) const;
3218   inline isl::schedule_node get_shared_ancestor(const isl::schedule_node &node2) const;
3219   inline unsigned tree_depth() const;
3220   inline unsigned get_tree_depth() const;
3221 };
3222 
3223 // declarations for isl::schedule_node_band
3224 
3225 class schedule_node_band : public schedule_node {
3226   template <class T>
3227   friend bool schedule_node::isa() const;
3228   friend schedule_node_band schedule_node::as<schedule_node_band>() const;
3229   static const auto type = isl_schedule_node_band;
3230 
3231 protected:
3232   inline explicit schedule_node_band(__isl_take isl_schedule_node *ptr);
3233 
3234 public:
3235   inline /* implicit */ schedule_node_band();
3236   inline /* implicit */ schedule_node_band(const schedule_node_band &obj);
3237   inline schedule_node_band &operator=(schedule_node_band obj);
3238   inline isl::ctx ctx() const;
3239 
3240   inline isl::union_set ast_build_options() const;
3241   inline isl::union_set get_ast_build_options() const;
3242   inline isl::set ast_isolate_option() const;
3243   inline isl::set get_ast_isolate_option() const;
3244   inline bool member_get_coincident(int pos) const;
3245   inline schedule_node_band member_set_coincident(int pos, int coincident) const;
3246   inline schedule_node_band mod(isl::multi_val mv) const;
3247   inline unsigned n_member() const;
3248   inline isl::multi_union_pw_aff partial_schedule() const;
3249   inline isl::multi_union_pw_aff get_partial_schedule() const;
3250   inline bool permutable() const;
3251   inline bool get_permutable() const;
3252   inline schedule_node_band scale(isl::multi_val mv) const;
3253   inline schedule_node_band scale_down(isl::multi_val mv) const;
3254   inline schedule_node_band set_ast_build_options(isl::union_set options) const;
3255   inline schedule_node_band set_permutable(int permutable) const;
3256   inline schedule_node_band shift(isl::multi_union_pw_aff shift) const;
3257   inline schedule_node_band split(int pos) const;
3258   inline schedule_node_band tile(isl::multi_val sizes) const;
3259   inline schedule_node_band member_set_ast_loop_default(int pos) const;
3260   inline schedule_node_band member_set_ast_loop_atomic(int pos) const;
3261   inline schedule_node_band member_set_ast_loop_unroll(int pos) const;
3262   inline schedule_node_band member_set_ast_loop_separate(int pos) const;
3263 };
3264 
3265 // declarations for isl::schedule_node_context
3266 
3267 class schedule_node_context : public schedule_node {
3268   template <class T>
3269   friend bool schedule_node::isa() const;
3270   friend schedule_node_context schedule_node::as<schedule_node_context>() const;
3271   static const auto type = isl_schedule_node_context;
3272 
3273 protected:
3274   inline explicit schedule_node_context(__isl_take isl_schedule_node *ptr);
3275 
3276 public:
3277   inline /* implicit */ schedule_node_context();
3278   inline /* implicit */ schedule_node_context(const schedule_node_context &obj);
3279   inline schedule_node_context &operator=(schedule_node_context obj);
3280   inline isl::ctx ctx() const;
3281 
3282   inline isl::set context() const;
3283   inline isl::set get_context() const;
3284 };
3285 
3286 // declarations for isl::schedule_node_domain
3287 
3288 class schedule_node_domain : public schedule_node {
3289   template <class T>
3290   friend bool schedule_node::isa() const;
3291   friend schedule_node_domain schedule_node::as<schedule_node_domain>() const;
3292   static const auto type = isl_schedule_node_domain;
3293 
3294 protected:
3295   inline explicit schedule_node_domain(__isl_take isl_schedule_node *ptr);
3296 
3297 public:
3298   inline /* implicit */ schedule_node_domain();
3299   inline /* implicit */ schedule_node_domain(const schedule_node_domain &obj);
3300   inline schedule_node_domain &operator=(schedule_node_domain obj);
3301   inline isl::ctx ctx() const;
3302 
3303   inline isl::union_set domain() const;
3304   inline isl::union_set get_domain() const;
3305 };
3306 
3307 // declarations for isl::schedule_node_expansion
3308 
3309 class schedule_node_expansion : public schedule_node {
3310   template <class T>
3311   friend bool schedule_node::isa() const;
3312   friend schedule_node_expansion schedule_node::as<schedule_node_expansion>() const;
3313   static const auto type = isl_schedule_node_expansion;
3314 
3315 protected:
3316   inline explicit schedule_node_expansion(__isl_take isl_schedule_node *ptr);
3317 
3318 public:
3319   inline /* implicit */ schedule_node_expansion();
3320   inline /* implicit */ schedule_node_expansion(const schedule_node_expansion &obj);
3321   inline schedule_node_expansion &operator=(schedule_node_expansion obj);
3322   inline isl::ctx ctx() const;
3323 
3324   inline isl::union_pw_multi_aff contraction() const;
3325   inline isl::union_pw_multi_aff get_contraction() const;
3326   inline isl::union_map expansion() const;
3327   inline isl::union_map get_expansion() const;
3328 };
3329 
3330 // declarations for isl::schedule_node_extension
3331 
3332 class schedule_node_extension : public schedule_node {
3333   template <class T>
3334   friend bool schedule_node::isa() const;
3335   friend schedule_node_extension schedule_node::as<schedule_node_extension>() const;
3336   static const auto type = isl_schedule_node_extension;
3337 
3338 protected:
3339   inline explicit schedule_node_extension(__isl_take isl_schedule_node *ptr);
3340 
3341 public:
3342   inline /* implicit */ schedule_node_extension();
3343   inline /* implicit */ schedule_node_extension(const schedule_node_extension &obj);
3344   inline schedule_node_extension &operator=(schedule_node_extension obj);
3345   inline isl::ctx ctx() const;
3346 
3347   inline isl::union_map extension() const;
3348   inline isl::union_map get_extension() const;
3349 };
3350 
3351 // declarations for isl::schedule_node_filter
3352 
3353 class schedule_node_filter : public schedule_node {
3354   template <class T>
3355   friend bool schedule_node::isa() const;
3356   friend schedule_node_filter schedule_node::as<schedule_node_filter>() const;
3357   static const auto type = isl_schedule_node_filter;
3358 
3359 protected:
3360   inline explicit schedule_node_filter(__isl_take isl_schedule_node *ptr);
3361 
3362 public:
3363   inline /* implicit */ schedule_node_filter();
3364   inline /* implicit */ schedule_node_filter(const schedule_node_filter &obj);
3365   inline schedule_node_filter &operator=(schedule_node_filter obj);
3366   inline isl::ctx ctx() const;
3367 
3368   inline isl::union_set filter() const;
3369   inline isl::union_set get_filter() const;
3370 };
3371 
3372 // declarations for isl::schedule_node_guard
3373 
3374 class schedule_node_guard : public schedule_node {
3375   template <class T>
3376   friend bool schedule_node::isa() const;
3377   friend schedule_node_guard schedule_node::as<schedule_node_guard>() const;
3378   static const auto type = isl_schedule_node_guard;
3379 
3380 protected:
3381   inline explicit schedule_node_guard(__isl_take isl_schedule_node *ptr);
3382 
3383 public:
3384   inline /* implicit */ schedule_node_guard();
3385   inline /* implicit */ schedule_node_guard(const schedule_node_guard &obj);
3386   inline schedule_node_guard &operator=(schedule_node_guard obj);
3387   inline isl::ctx ctx() const;
3388 
3389   inline isl::set guard() const;
3390   inline isl::set get_guard() const;
3391 };
3392 
3393 // declarations for isl::schedule_node_leaf
3394 
3395 class schedule_node_leaf : public schedule_node {
3396   template <class T>
3397   friend bool schedule_node::isa() const;
3398   friend schedule_node_leaf schedule_node::as<schedule_node_leaf>() const;
3399   static const auto type = isl_schedule_node_leaf;
3400 
3401 protected:
3402   inline explicit schedule_node_leaf(__isl_take isl_schedule_node *ptr);
3403 
3404 public:
3405   inline /* implicit */ schedule_node_leaf();
3406   inline /* implicit */ schedule_node_leaf(const schedule_node_leaf &obj);
3407   inline schedule_node_leaf &operator=(schedule_node_leaf obj);
3408   inline isl::ctx ctx() const;
3409 
3410 };
3411 
3412 // declarations for isl::schedule_node_mark
3413 
3414 class schedule_node_mark : public schedule_node {
3415   template <class T>
3416   friend bool schedule_node::isa() const;
3417   friend schedule_node_mark schedule_node::as<schedule_node_mark>() const;
3418   static const auto type = isl_schedule_node_mark;
3419 
3420 protected:
3421   inline explicit schedule_node_mark(__isl_take isl_schedule_node *ptr);
3422 
3423 public:
3424   inline /* implicit */ schedule_node_mark();
3425   inline /* implicit */ schedule_node_mark(const schedule_node_mark &obj);
3426   inline schedule_node_mark &operator=(schedule_node_mark obj);
3427   inline isl::ctx ctx() const;
3428 
3429 };
3430 
3431 // declarations for isl::schedule_node_sequence
3432 
3433 class schedule_node_sequence : public schedule_node {
3434   template <class T>
3435   friend bool schedule_node::isa() const;
3436   friend schedule_node_sequence schedule_node::as<schedule_node_sequence>() const;
3437   static const auto type = isl_schedule_node_sequence;
3438 
3439 protected:
3440   inline explicit schedule_node_sequence(__isl_take isl_schedule_node *ptr);
3441 
3442 public:
3443   inline /* implicit */ schedule_node_sequence();
3444   inline /* implicit */ schedule_node_sequence(const schedule_node_sequence &obj);
3445   inline schedule_node_sequence &operator=(schedule_node_sequence obj);
3446   inline isl::ctx ctx() const;
3447 
3448 };
3449 
3450 // declarations for isl::schedule_node_set
3451 
3452 class schedule_node_set : public schedule_node {
3453   template <class T>
3454   friend bool schedule_node::isa() const;
3455   friend schedule_node_set schedule_node::as<schedule_node_set>() const;
3456   static const auto type = isl_schedule_node_set;
3457 
3458 protected:
3459   inline explicit schedule_node_set(__isl_take isl_schedule_node *ptr);
3460 
3461 public:
3462   inline /* implicit */ schedule_node_set();
3463   inline /* implicit */ schedule_node_set(const schedule_node_set &obj);
3464   inline schedule_node_set &operator=(schedule_node_set obj);
3465   inline isl::ctx ctx() const;
3466 
3467 };
3468 
3469 // declarations for isl::set
3470 inline set manage(__isl_take isl_set *ptr);
3471 inline set manage_copy(__isl_keep isl_set *ptr);
3472 
3473 class set {
3474   friend inline set manage(__isl_take isl_set *ptr);
3475   friend inline set manage_copy(__isl_keep isl_set *ptr);
3476 
3477 protected:
3478   isl_set *ptr = nullptr;
3479 
3480   inline explicit set(__isl_take isl_set *ptr);
3481 
3482 public:
3483   inline /* implicit */ set();
3484   inline /* implicit */ set(const set &obj);
3485   inline /* implicit */ set(isl::basic_set bset);
3486   inline /* implicit */ set(isl::point pnt);
3487   inline explicit set(isl::ctx ctx, const std::string &str);
3488   inline set &operator=(set obj);
3489   inline ~set();
3490   inline __isl_give isl_set *copy() const &;
3491   inline __isl_give isl_set *copy() && = delete;
3492   inline __isl_keep isl_set *get() const;
3493   inline __isl_give isl_set *release();
3494   inline bool is_null() const;
3495   inline isl::ctx ctx() const;
3496 
3497   inline isl::basic_set affine_hull() const;
3498   inline isl::set apply(isl::map map) const;
3499   inline isl::union_set apply(const isl::union_map &umap) const;
3500   inline isl::set apply(const isl::basic_map &map) const;
3501   inline isl::pw_multi_aff as_pw_multi_aff() const;
3502   inline isl::set as_set() const;
3503   inline isl::set bind(isl::multi_id tuple) const;
3504   inline isl::set coalesce() const;
3505   inline isl::set complement() const;
3506   inline isl::union_set compute_divs() const;
3507   inline isl::set detect_equalities() const;
3508   inline isl::val dim_max_val(int pos) const;
3509   inline isl::val dim_min_val(int pos) const;
3510   static inline isl::set empty(isl::space space);
3511   inline bool every_set(const std::function<bool(isl::set)> &test) const;
3512   inline isl::set extract_set(const isl::space &space) const;
3513   inline isl::set flatten() const;
3514   inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
3515   inline void foreach_point(const std::function<void(isl::point)> &fn) const;
3516   inline void foreach_set(const std::function<void(isl::set)> &fn) const;
3517   inline isl::set gist(isl::set context) const;
3518   inline isl::union_set gist(const isl::union_set &context) const;
3519   inline isl::set gist(const isl::basic_set &context) const;
3520   inline isl::set gist(const isl::point &context) const;
3521   inline isl::union_set gist_params(const isl::set &set) const;
3522   inline isl::map identity() const;
3523   inline isl::pw_aff indicator_function() const;
3524   inline isl::map insert_domain(isl::space domain) const;
3525   inline isl::set intersect(isl::set set2) const;
3526   inline isl::union_set intersect(const isl::union_set &uset2) const;
3527   inline isl::set intersect(const isl::basic_set &set2) const;
3528   inline isl::set intersect(const isl::point &set2) const;
3529   inline isl::set intersect_params(isl::set params) const;
3530   inline bool involves_locals() const;
3531   inline bool is_disjoint(const isl::set &set2) const;
3532   inline bool is_disjoint(const isl::union_set &uset2) const;
3533   inline bool is_disjoint(const isl::basic_set &set2) const;
3534   inline bool is_disjoint(const isl::point &set2) const;
3535   inline bool is_empty() const;
3536   inline bool is_equal(const isl::set &set2) const;
3537   inline bool is_equal(const isl::union_set &uset2) const;
3538   inline bool is_equal(const isl::basic_set &set2) const;
3539   inline bool is_equal(const isl::point &set2) const;
3540   inline bool is_singleton() const;
3541   inline bool is_strict_subset(const isl::set &set2) const;
3542   inline bool is_strict_subset(const isl::union_set &uset2) const;
3543   inline bool is_strict_subset(const isl::basic_set &set2) const;
3544   inline bool is_strict_subset(const isl::point &set2) const;
3545   inline bool is_subset(const isl::set &set2) const;
3546   inline bool is_subset(const isl::union_set &uset2) const;
3547   inline bool is_subset(const isl::basic_set &set2) const;
3548   inline bool is_subset(const isl::point &set2) const;
3549   inline bool is_wrapping() const;
3550   inline bool isa_set() const;
3551   inline isl::set lexmax() const;
3552   inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
3553   inline isl::set lexmin() const;
3554   inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
3555   inline isl::set lower_bound(isl::multi_pw_aff lower) const;
3556   inline isl::set lower_bound(isl::multi_val lower) const;
3557   inline isl::multi_pw_aff max_multi_pw_aff() const;
3558   inline isl::val max_val(const isl::aff &obj) const;
3559   inline isl::multi_pw_aff min_multi_pw_aff() const;
3560   inline isl::val min_val(const isl::aff &obj) const;
3561   inline unsigned n_basic_set() const;
3562   inline isl::set params() const;
3563   inline isl::multi_val plain_multi_val_if_fixed() const;
3564   inline isl::multi_val get_plain_multi_val_if_fixed() const;
3565   inline isl::basic_set polyhedral_hull() const;
3566   inline isl::set preimage(isl::multi_aff ma) const;
3567   inline isl::set preimage(isl::multi_pw_aff mpa) const;
3568   inline isl::set preimage(isl::pw_multi_aff pma) const;
3569   inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
3570   inline isl::set product(isl::set set2) const;
3571   inline isl::set project_out_all_params() const;
3572   inline isl::set project_out_param(isl::id id) const;
3573   inline isl::set project_out_param(const std::string &id) const;
3574   inline isl::set project_out_param(isl::id_list list) const;
3575   inline isl::pw_multi_aff pw_multi_aff_on_domain(isl::multi_val mv) const;
3576   inline isl::basic_set sample() const;
3577   inline isl::point sample_point() const;
3578   inline isl::set_list set_list() const;
3579   inline isl::fixed_box simple_fixed_box_hull() const;
3580   inline isl::fixed_box get_simple_fixed_box_hull() const;
3581   inline isl::space space() const;
3582   inline isl::space get_space() const;
3583   inline isl::val stride(int pos) const;
3584   inline isl::val get_stride(int pos) const;
3585   inline isl::set subtract(isl::set set2) const;
3586   inline isl::union_set subtract(const isl::union_set &uset2) const;
3587   inline isl::set subtract(const isl::basic_set &set2) const;
3588   inline isl::set subtract(const isl::point &set2) const;
3589   inline isl::set_list to_list() const;
3590   inline isl::union_set to_union_set() const;
3591   inline isl::map translation() const;
3592   inline unsigned tuple_dim() const;
3593   inline isl::set unbind_params(isl::multi_id tuple) const;
3594   inline isl::map unbind_params_insert_domain(isl::multi_id domain) const;
3595   inline isl::set unite(isl::set set2) const;
3596   inline isl::union_set unite(const isl::union_set &uset2) const;
3597   inline isl::set unite(const isl::basic_set &set2) const;
3598   inline isl::set unite(const isl::point &set2) const;
3599   static inline isl::set universe(isl::space space);
3600   inline isl::basic_set unshifted_simple_hull() const;
3601   inline isl::map unwrap() const;
3602   inline isl::set upper_bound(isl::multi_pw_aff upper) const;
3603   inline isl::set upper_bound(isl::multi_val upper) const;
3604 };
3605 
3606 // declarations for isl::set_list
3607 inline set_list manage(__isl_take isl_set_list *ptr);
3608 inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3609 
3610 class set_list {
3611   friend inline set_list manage(__isl_take isl_set_list *ptr);
3612   friend inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3613 
3614 protected:
3615   isl_set_list *ptr = nullptr;
3616 
3617   inline explicit set_list(__isl_take isl_set_list *ptr);
3618 
3619 public:
3620   inline /* implicit */ set_list();
3621   inline /* implicit */ set_list(const set_list &obj);
3622   inline explicit set_list(isl::ctx ctx, int n);
3623   inline explicit set_list(isl::set el);
3624   inline explicit set_list(isl::ctx ctx, const std::string &str);
3625   inline set_list &operator=(set_list obj);
3626   inline ~set_list();
3627   inline __isl_give isl_set_list *copy() const &;
3628   inline __isl_give isl_set_list *copy() && = delete;
3629   inline __isl_keep isl_set_list *get() const;
3630   inline __isl_give isl_set_list *release();
3631   inline bool is_null() const;
3632   inline isl::ctx ctx() const;
3633 
3634   inline isl::set_list add(isl::set el) const;
3635   inline isl::set at(int index) const;
3636   inline isl::set get_at(int index) const;
3637   inline isl::set_list clear() const;
3638   inline isl::set_list concat(isl::set_list list2) const;
3639   inline isl::set_list drop(unsigned int first, unsigned int n) const;
3640   inline void foreach(const std::function<void(isl::set)> &fn) const;
3641   inline isl::set_list insert(unsigned int pos, isl::set el) const;
3642   inline unsigned size() const;
3643 };
3644 
3645 // declarations for isl::space
3646 inline space manage(__isl_take isl_space *ptr);
3647 inline space manage_copy(__isl_keep isl_space *ptr);
3648 
3649 class space {
3650   friend inline space manage(__isl_take isl_space *ptr);
3651   friend inline space manage_copy(__isl_keep isl_space *ptr);
3652 
3653 protected:
3654   isl_space *ptr = nullptr;
3655 
3656   inline explicit space(__isl_take isl_space *ptr);
3657 
3658 public:
3659   inline /* implicit */ space();
3660   inline /* implicit */ space(const space &obj);
3661   inline space &operator=(space obj);
3662   inline ~space();
3663   inline __isl_give isl_space *copy() const &;
3664   inline __isl_give isl_space *copy() && = delete;
3665   inline __isl_keep isl_space *get() const;
3666   inline __isl_give isl_space *release();
3667   inline bool is_null() const;
3668   inline isl::ctx ctx() const;
3669 
3670   inline isl::space add_named_tuple(isl::id tuple_id, unsigned int dim) const;
3671   inline isl::space add_named_tuple(const std::string &tuple_id, unsigned int dim) const;
3672   inline isl::space add_param(isl::id id) const;
3673   inline isl::space add_param(const std::string &id) const;
3674   inline isl::space add_unnamed_tuple(unsigned int dim) const;
3675   inline isl::space curry() const;
3676   inline isl::space domain() const;
3677   inline isl::multi_aff domain_map_multi_aff() const;
3678   inline isl::pw_multi_aff domain_map_pw_multi_aff() const;
3679   inline isl::id domain_tuple_id() const;
3680   inline isl::id get_domain_tuple_id() const;
3681   inline isl::space flatten_domain() const;
3682   inline isl::space flatten_range() const;
3683   inline bool has_domain_tuple_id() const;
3684   inline bool has_range_tuple_id() const;
3685   inline isl::multi_aff identity_multi_aff_on_domain() const;
3686   inline isl::multi_pw_aff identity_multi_pw_aff_on_domain() const;
3687   inline isl::pw_multi_aff identity_pw_multi_aff_on_domain() const;
3688   inline bool is_equal(const isl::space &space2) const;
3689   inline bool is_wrapping() const;
3690   inline isl::space map_from_set() const;
3691   inline isl::multi_aff multi_aff(isl::aff_list list) const;
3692   inline isl::multi_aff multi_aff_on_domain(isl::multi_val mv) const;
3693   inline isl::multi_id multi_id(isl::id_list list) const;
3694   inline isl::multi_pw_aff multi_pw_aff(isl::pw_aff_list list) const;
3695   inline isl::multi_union_pw_aff multi_union_pw_aff(isl::union_pw_aff_list list) const;
3696   inline isl::multi_val multi_val(isl::val_list list) const;
3697   inline isl::aff param_aff_on_domain(isl::id id) const;
3698   inline isl::aff param_aff_on_domain(const std::string &id) const;
3699   inline isl::space params() const;
3700   inline isl::space product(isl::space right) const;
3701   inline isl::space range() const;
3702   inline isl::multi_aff range_map_multi_aff() const;
3703   inline isl::pw_multi_aff range_map_pw_multi_aff() const;
3704   inline isl::space range_reverse() const;
3705   inline isl::id range_tuple_id() const;
3706   inline isl::id get_range_tuple_id() const;
3707   inline isl::space reverse() const;
3708   inline isl::space set_domain_tuple(isl::id id) const;
3709   inline isl::space set_domain_tuple(const std::string &id) const;
3710   inline isl::space set_range_tuple(isl::id id) const;
3711   inline isl::space set_range_tuple(const std::string &id) const;
3712   inline isl::space uncurry() const;
3713   static inline isl::space unit(isl::ctx ctx);
3714   inline isl::map universe_map() const;
3715   inline isl::set universe_set() const;
3716   inline isl::space unwrap() const;
3717   inline isl::space wrap() const;
3718   inline isl::aff zero_aff_on_domain() const;
3719   inline isl::multi_aff zero_multi_aff() const;
3720   inline isl::multi_pw_aff zero_multi_pw_aff() const;
3721   inline isl::multi_union_pw_aff zero_multi_union_pw_aff() const;
3722   inline isl::multi_val zero_multi_val() const;
3723 };
3724 
3725 // declarations for isl::union_access_info
3726 inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3727 inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3728 
3729 class union_access_info {
3730   friend inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3731   friend inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3732 
3733 protected:
3734   isl_union_access_info *ptr = nullptr;
3735 
3736   inline explicit union_access_info(__isl_take isl_union_access_info *ptr);
3737 
3738 public:
3739   inline /* implicit */ union_access_info();
3740   inline /* implicit */ union_access_info(const union_access_info &obj);
3741   inline explicit union_access_info(isl::union_map sink);
3742   inline union_access_info &operator=(union_access_info obj);
3743   inline ~union_access_info();
3744   inline __isl_give isl_union_access_info *copy() const &;
3745   inline __isl_give isl_union_access_info *copy() && = delete;
3746   inline __isl_keep isl_union_access_info *get() const;
3747   inline __isl_give isl_union_access_info *release();
3748   inline bool is_null() const;
3749   inline isl::ctx ctx() const;
3750 
3751   inline isl::union_flow compute_flow() const;
3752   inline isl::union_access_info set_kill(isl::union_map kill) const;
3753   inline isl::union_access_info set_may_source(isl::union_map may_source) const;
3754   inline isl::union_access_info set_must_source(isl::union_map must_source) const;
3755   inline isl::union_access_info set_schedule(isl::schedule schedule) const;
3756   inline isl::union_access_info set_schedule_map(isl::union_map schedule_map) const;
3757 };
3758 
3759 // declarations for isl::union_flow
3760 inline union_flow manage(__isl_take isl_union_flow *ptr);
3761 inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3762 
3763 class union_flow {
3764   friend inline union_flow manage(__isl_take isl_union_flow *ptr);
3765   friend inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3766 
3767 protected:
3768   isl_union_flow *ptr = nullptr;
3769 
3770   inline explicit union_flow(__isl_take isl_union_flow *ptr);
3771 
3772 public:
3773   inline /* implicit */ union_flow();
3774   inline /* implicit */ union_flow(const union_flow &obj);
3775   inline union_flow &operator=(union_flow obj);
3776   inline ~union_flow();
3777   inline __isl_give isl_union_flow *copy() const &;
3778   inline __isl_give isl_union_flow *copy() && = delete;
3779   inline __isl_keep isl_union_flow *get() const;
3780   inline __isl_give isl_union_flow *release();
3781   inline bool is_null() const;
3782   inline isl::ctx ctx() const;
3783 
3784   inline isl::union_map full_may_dependence() const;
3785   inline isl::union_map get_full_may_dependence() const;
3786   inline isl::union_map full_must_dependence() const;
3787   inline isl::union_map get_full_must_dependence() const;
3788   inline isl::union_map may_dependence() const;
3789   inline isl::union_map get_may_dependence() const;
3790   inline isl::union_map may_no_source() const;
3791   inline isl::union_map get_may_no_source() const;
3792   inline isl::union_map must_dependence() const;
3793   inline isl::union_map get_must_dependence() const;
3794   inline isl::union_map must_no_source() const;
3795   inline isl::union_map get_must_no_source() const;
3796 };
3797 
3798 // declarations for isl::union_map
3799 inline union_map manage(__isl_take isl_union_map *ptr);
3800 inline union_map manage_copy(__isl_keep isl_union_map *ptr);
3801 
3802 class union_map {
3803   friend inline union_map manage(__isl_take isl_union_map *ptr);
3804   friend inline union_map manage_copy(__isl_keep isl_union_map *ptr);
3805 
3806 protected:
3807   isl_union_map *ptr = nullptr;
3808 
3809   inline explicit union_map(__isl_take isl_union_map *ptr);
3810 
3811 public:
3812   inline /* implicit */ union_map();
3813   inline /* implicit */ union_map(const union_map &obj);
3814   inline /* implicit */ union_map(isl::basic_map bmap);
3815   inline /* implicit */ union_map(isl::map map);
3816   inline explicit union_map(isl::ctx ctx, const std::string &str);
3817   inline union_map &operator=(union_map obj);
3818   inline ~union_map();
3819   inline __isl_give isl_union_map *copy() const &;
3820   inline __isl_give isl_union_map *copy() && = delete;
3821   inline __isl_keep isl_union_map *get() const;
3822   inline __isl_give isl_union_map *release();
3823   inline bool is_null() const;
3824   inline isl::ctx ctx() const;
3825 
3826   inline isl::union_map affine_hull() const;
3827   inline isl::union_map apply_domain(isl::union_map umap2) const;
3828   inline isl::union_map apply_range(isl::union_map umap2) const;
3829   inline isl::map as_map() const;
3830   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
3831   inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
3832   inline isl::union_set bind_range(isl::multi_id tuple) const;
3833   inline isl::union_map coalesce() const;
3834   inline isl::union_map compute_divs() const;
3835   inline isl::union_map curry() const;
3836   inline isl::union_set deltas() const;
3837   inline isl::union_map detect_equalities() const;
3838   inline isl::union_set domain() const;
3839   inline isl::union_map domain_factor_domain() const;
3840   inline isl::union_map domain_factor_range() const;
3841   inline isl::union_map domain_map() const;
3842   inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
3843   inline isl::union_map domain_product(isl::union_map umap2) const;
3844   static inline isl::union_map empty(isl::ctx ctx);
3845   inline isl::union_map eq_at(isl::multi_union_pw_aff mupa) const;
3846   inline bool every_map(const std::function<bool(isl::map)> &test) const;
3847   inline isl::map extract_map(isl::space space) const;
3848   inline isl::union_map factor_domain() const;
3849   inline isl::union_map factor_range() const;
3850   inline isl::union_map fixed_power(isl::val exp) const;
3851   inline isl::union_map fixed_power(long exp) const;
3852   inline void foreach_map(const std::function<void(isl::map)> &fn) const;
3853   static inline isl::union_map from(isl::multi_union_pw_aff mupa);
3854   static inline isl::union_map from(isl::union_pw_multi_aff upma);
3855   static inline isl::union_map from_domain(isl::union_set uset);
3856   static inline isl::union_map from_domain_and_range(isl::union_set domain, isl::union_set range);
3857   static inline isl::union_map from_range(isl::union_set uset);
3858   inline isl::union_map gist(isl::union_map context) const;
3859   inline isl::union_map gist_domain(isl::union_set uset) const;
3860   inline isl::union_map gist_params(isl::set set) const;
3861   inline isl::union_map gist_range(isl::union_set uset) const;
3862   inline isl::union_map intersect(isl::union_map umap2) const;
3863   inline isl::union_map intersect_domain(isl::space space) const;
3864   inline isl::union_map intersect_domain(isl::union_set uset) const;
3865   inline isl::union_map intersect_domain_factor_domain(isl::union_map factor) const;
3866   inline isl::union_map intersect_domain_factor_range(isl::union_map factor) const;
3867   inline isl::union_map intersect_params(isl::set set) const;
3868   inline isl::union_map intersect_range(isl::space space) const;
3869   inline isl::union_map intersect_range(isl::union_set uset) const;
3870   inline isl::union_map intersect_range_factor_domain(isl::union_map factor) const;
3871   inline isl::union_map intersect_range_factor_range(isl::union_map factor) const;
3872   inline bool is_bijective() const;
3873   inline bool is_disjoint(const isl::union_map &umap2) const;
3874   inline bool is_empty() const;
3875   inline bool is_equal(const isl::union_map &umap2) const;
3876   inline bool is_injective() const;
3877   inline bool is_single_valued() const;
3878   inline bool is_strict_subset(const isl::union_map &umap2) const;
3879   inline bool is_subset(const isl::union_map &umap2) const;
3880   inline bool isa_map() const;
3881   inline isl::union_map lexmax() const;
3882   inline isl::union_map lexmin() const;
3883   inline isl::map_list map_list() const;
3884   inline isl::map_list get_map_list() const;
3885   inline isl::union_map polyhedral_hull() const;
3886   inline isl::union_map preimage_domain(isl::multi_aff ma) const;
3887   inline isl::union_map preimage_domain(isl::multi_pw_aff mpa) const;
3888   inline isl::union_map preimage_domain(isl::pw_multi_aff pma) const;
3889   inline isl::union_map preimage_domain(isl::union_pw_multi_aff upma) const;
3890   inline isl::union_map preimage_range(isl::multi_aff ma) const;
3891   inline isl::union_map preimage_range(isl::pw_multi_aff pma) const;
3892   inline isl::union_map preimage_range(isl::union_pw_multi_aff upma) const;
3893   inline isl::union_map product(isl::union_map umap2) const;
3894   inline isl::union_map project_out_all_params() const;
3895   inline isl::union_set range() const;
3896   inline isl::union_map range_factor_domain() const;
3897   inline isl::union_map range_factor_range() const;
3898   inline isl::union_map range_map() const;
3899   inline isl::union_map range_product(isl::union_map umap2) const;
3900   inline isl::union_map range_reverse() const;
3901   inline isl::union_map reverse() const;
3902   inline isl::space space() const;
3903   inline isl::space get_space() const;
3904   inline isl::union_map subtract(isl::union_map umap2) const;
3905   inline isl::union_map subtract_domain(isl::union_set dom) const;
3906   inline isl::union_map subtract_range(isl::union_set dom) const;
3907   inline isl::union_map uncurry() const;
3908   inline isl::union_map unite(isl::union_map umap2) const;
3909   inline isl::union_map universe() const;
3910   inline isl::union_set wrap() const;
3911   inline isl::union_map zip() const;
3912 };
3913 
3914 // declarations for isl::union_pw_aff
3915 inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
3916 inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
3917 
3918 class union_pw_aff {
3919   friend inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
3920   friend inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
3921 
3922 protected:
3923   isl_union_pw_aff *ptr = nullptr;
3924 
3925   inline explicit union_pw_aff(__isl_take isl_union_pw_aff *ptr);
3926 
3927 public:
3928   inline /* implicit */ union_pw_aff();
3929   inline /* implicit */ union_pw_aff(const union_pw_aff &obj);
3930   inline /* implicit */ union_pw_aff(isl::aff aff);
3931   inline /* implicit */ union_pw_aff(isl::pw_aff pa);
3932   inline explicit union_pw_aff(isl::ctx ctx, const std::string &str);
3933   inline union_pw_aff &operator=(union_pw_aff obj);
3934   inline ~union_pw_aff();
3935   inline __isl_give isl_union_pw_aff *copy() const &;
3936   inline __isl_give isl_union_pw_aff *copy() && = delete;
3937   inline __isl_keep isl_union_pw_aff *get() const;
3938   inline __isl_give isl_union_pw_aff *release();
3939   inline bool is_null() const;
3940   inline isl::ctx ctx() const;
3941 
3942   inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
3943   inline isl::union_pw_aff add(isl::union_pw_aff upa2) const;
3944   inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
3945   inline isl::union_pw_aff add(const isl::aff &upa2) const;
3946   inline isl::union_pw_aff add(const isl::pw_aff &upa2) const;
3947   inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
3948   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
3949   inline isl::pw_multi_aff as_pw_multi_aff() const;
3950   inline isl::union_map as_union_map() const;
3951   inline isl::union_pw_aff at(int pos) const;
3952   inline isl::union_set bind(const isl::multi_id &tuple) const;
3953   inline isl::union_set bind(isl::id id) const;
3954   inline isl::union_set bind(const std::string &id) const;
3955   inline isl::union_pw_aff coalesce() const;
3956   inline isl::union_set domain() const;
3957   inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
3958   inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
3959   inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
3960   inline isl::union_pw_aff gist(isl::union_set context) const;
3961   inline bool has_range_tuple_id() const;
3962   inline isl::union_pw_aff intersect_domain(isl::space space) const;
3963   inline isl::union_pw_aff intersect_domain(isl::union_set uset) const;
3964   inline isl::union_pw_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
3965   inline isl::union_pw_aff intersect_domain_wrapped_range(isl::union_set uset) const;
3966   inline isl::union_pw_aff intersect_params(isl::set set) const;
3967   inline bool involves_locals() const;
3968   inline bool involves_nan() const;
3969   inline bool isa_pw_multi_aff() const;
3970   inline isl::union_pw_aff_list list() const;
3971   inline isl::multi_union_pw_aff neg() const;
3972   inline bool plain_is_empty() const;
3973   inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
3974   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
3975   inline isl::union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
3976   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
3977   inline isl::union_pw_multi_aff range_factor_domain() const;
3978   inline isl::union_pw_multi_aff range_factor_range() const;
3979   inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
3980   inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
3981   inline isl::id range_tuple_id() const;
3982   inline isl::multi_union_pw_aff reset_range_tuple_id() const;
3983   inline isl::multi_union_pw_aff scale(const isl::multi_val &mv) const;
3984   inline isl::multi_union_pw_aff scale(const isl::val &v) const;
3985   inline isl::multi_union_pw_aff scale(long v) const;
3986   inline isl::multi_union_pw_aff scale_down(const isl::multi_val &mv) const;
3987   inline isl::multi_union_pw_aff scale_down(const isl::val &v) const;
3988   inline isl::multi_union_pw_aff scale_down(long v) const;
3989   inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
3990   inline isl::multi_union_pw_aff set_range_tuple(const isl::id &id) const;
3991   inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
3992   inline unsigned size() const;
3993   inline isl::space space() const;
3994   inline isl::space get_space() const;
3995   inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
3996   inline isl::union_pw_aff sub(isl::union_pw_aff upa2) const;
3997   inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
3998   inline isl::union_pw_aff sub(const isl::aff &upa2) const;
3999   inline isl::union_pw_aff sub(const isl::pw_aff &upa2) const;
4000   inline isl::union_pw_aff subtract_domain(isl::space space) const;
4001   inline isl::union_pw_aff subtract_domain(isl::union_set uset) const;
4002   inline isl::union_pw_aff_list to_list() const;
4003   inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
4004   inline isl::union_pw_aff union_add(isl::union_pw_aff upa2) const;
4005   inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
4006   inline isl::union_pw_aff union_add(const isl::aff &upa2) const;
4007   inline isl::union_pw_aff union_add(const isl::pw_aff &upa2) const;
4008 };
4009 
4010 // declarations for isl::union_pw_aff_list
4011 inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4012 inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4013 
4014 class union_pw_aff_list {
4015   friend inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4016   friend inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4017 
4018 protected:
4019   isl_union_pw_aff_list *ptr = nullptr;
4020 
4021   inline explicit union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr);
4022 
4023 public:
4024   inline /* implicit */ union_pw_aff_list();
4025   inline /* implicit */ union_pw_aff_list(const union_pw_aff_list &obj);
4026   inline explicit union_pw_aff_list(isl::ctx ctx, int n);
4027   inline explicit union_pw_aff_list(isl::union_pw_aff el);
4028   inline explicit union_pw_aff_list(isl::ctx ctx, const std::string &str);
4029   inline union_pw_aff_list &operator=(union_pw_aff_list obj);
4030   inline ~union_pw_aff_list();
4031   inline __isl_give isl_union_pw_aff_list *copy() const &;
4032   inline __isl_give isl_union_pw_aff_list *copy() && = delete;
4033   inline __isl_keep isl_union_pw_aff_list *get() const;
4034   inline __isl_give isl_union_pw_aff_list *release();
4035   inline bool is_null() const;
4036   inline isl::ctx ctx() const;
4037 
4038   inline isl::union_pw_aff_list add(isl::union_pw_aff el) const;
4039   inline isl::union_pw_aff at(int index) const;
4040   inline isl::union_pw_aff get_at(int index) const;
4041   inline isl::union_pw_aff_list clear() const;
4042   inline isl::union_pw_aff_list concat(isl::union_pw_aff_list list2) const;
4043   inline isl::union_pw_aff_list drop(unsigned int first, unsigned int n) const;
4044   inline void foreach(const std::function<void(isl::union_pw_aff)> &fn) const;
4045   inline isl::union_pw_aff_list insert(unsigned int pos, isl::union_pw_aff el) const;
4046   inline unsigned size() const;
4047 };
4048 
4049 // declarations for isl::union_pw_multi_aff
4050 inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4051 inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4052 
4053 class union_pw_multi_aff {
4054   friend inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4055   friend inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4056 
4057 protected:
4058   isl_union_pw_multi_aff *ptr = nullptr;
4059 
4060   inline explicit union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr);
4061 
4062 public:
4063   inline /* implicit */ union_pw_multi_aff();
4064   inline /* implicit */ union_pw_multi_aff(const union_pw_multi_aff &obj);
4065   inline /* implicit */ union_pw_multi_aff(isl::multi_aff ma);
4066   inline /* implicit */ union_pw_multi_aff(isl::pw_multi_aff pma);
4067   inline /* implicit */ union_pw_multi_aff(isl::union_pw_aff upa);
4068   inline explicit union_pw_multi_aff(isl::ctx ctx, const std::string &str);
4069   inline union_pw_multi_aff &operator=(union_pw_multi_aff obj);
4070   inline ~union_pw_multi_aff();
4071   inline __isl_give isl_union_pw_multi_aff *copy() const &;
4072   inline __isl_give isl_union_pw_multi_aff *copy() && = delete;
4073   inline __isl_keep isl_union_pw_multi_aff *get() const;
4074   inline __isl_give isl_union_pw_multi_aff *release();
4075   inline bool is_null() const;
4076   inline isl::ctx ctx() const;
4077 
4078   inline isl::union_pw_multi_aff add(isl::union_pw_multi_aff upma2) const;
4079   inline isl::union_pw_multi_aff apply(isl::union_pw_multi_aff upma2) const;
4080   inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4081   inline isl::pw_multi_aff as_pw_multi_aff() const;
4082   inline isl::union_map as_union_map() const;
4083   inline isl::union_pw_multi_aff coalesce() const;
4084   inline isl::union_set domain() const;
4085   static inline isl::union_pw_multi_aff empty(isl::ctx ctx);
4086   inline isl::pw_multi_aff extract_pw_multi_aff(isl::space space) const;
4087   inline isl::union_pw_multi_aff flat_range_product(isl::union_pw_multi_aff upma2) const;
4088   inline isl::union_pw_multi_aff gist(isl::union_set context) const;
4089   inline isl::union_pw_multi_aff intersect_domain(isl::space space) const;
4090   inline isl::union_pw_multi_aff intersect_domain(isl::union_set uset) const;
4091   inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
4092   inline isl::union_pw_multi_aff intersect_domain_wrapped_range(isl::union_set uset) const;
4093   inline isl::union_pw_multi_aff intersect_params(isl::set set) const;
4094   inline bool involves_locals() const;
4095   inline bool isa_pw_multi_aff() const;
4096   inline bool plain_is_empty() const;
4097   inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const;
4098   inline isl::union_pw_multi_aff pullback(isl::union_pw_multi_aff upma2) const;
4099   inline isl::pw_multi_aff_list pw_multi_aff_list() const;
4100   inline isl::pw_multi_aff_list get_pw_multi_aff_list() const;
4101   inline isl::union_pw_multi_aff range_factor_domain() const;
4102   inline isl::union_pw_multi_aff range_factor_range() const;
4103   inline isl::union_pw_multi_aff range_product(isl::union_pw_multi_aff upma2) const;
4104   inline isl::space space() const;
4105   inline isl::space get_space() const;
4106   inline isl::union_pw_multi_aff sub(isl::union_pw_multi_aff upma2) const;
4107   inline isl::union_pw_multi_aff subtract_domain(isl::space space) const;
4108   inline isl::union_pw_multi_aff subtract_domain(isl::union_set uset) const;
4109   inline isl::union_pw_multi_aff union_add(isl::union_pw_multi_aff upma2) const;
4110 };
4111 
4112 // declarations for isl::union_set
4113 inline union_set manage(__isl_take isl_union_set *ptr);
4114 inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4115 
4116 class union_set {
4117   friend inline union_set manage(__isl_take isl_union_set *ptr);
4118   friend inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4119 
4120 protected:
4121   isl_union_set *ptr = nullptr;
4122 
4123   inline explicit union_set(__isl_take isl_union_set *ptr);
4124 
4125 public:
4126   inline /* implicit */ union_set();
4127   inline /* implicit */ union_set(const union_set &obj);
4128   inline /* implicit */ union_set(isl::basic_set bset);
4129   inline /* implicit */ union_set(isl::point pnt);
4130   inline /* implicit */ union_set(isl::set set);
4131   inline explicit union_set(isl::ctx ctx, const std::string &str);
4132   inline union_set &operator=(union_set obj);
4133   inline ~union_set();
4134   inline __isl_give isl_union_set *copy() const &;
4135   inline __isl_give isl_union_set *copy() && = delete;
4136   inline __isl_keep isl_union_set *get() const;
4137   inline __isl_give isl_union_set *release();
4138   inline bool is_null() const;
4139   inline isl::ctx ctx() const;
4140 
4141   inline isl::union_set affine_hull() const;
4142   inline isl::union_set apply(isl::union_map umap) const;
4143   inline isl::set as_set() const;
4144   inline isl::union_set coalesce() const;
4145   inline isl::union_set compute_divs() const;
4146   inline isl::union_set detect_equalities() const;
4147   static inline isl::union_set empty(isl::ctx ctx);
4148   inline bool every_set(const std::function<bool(isl::set)> &test) const;
4149   inline isl::set extract_set(isl::space space) const;
4150   inline void foreach_point(const std::function<void(isl::point)> &fn) const;
4151   inline void foreach_set(const std::function<void(isl::set)> &fn) const;
4152   inline isl::union_set gist(isl::union_set context) const;
4153   inline isl::union_set gist_params(isl::set set) const;
4154   inline isl::union_map identity() const;
4155   inline isl::union_set intersect(isl::union_set uset2) const;
4156   inline isl::union_set intersect_params(isl::set set) const;
4157   inline bool is_disjoint(const isl::union_set &uset2) const;
4158   inline bool is_empty() const;
4159   inline bool is_equal(const isl::union_set &uset2) const;
4160   inline bool is_strict_subset(const isl::union_set &uset2) const;
4161   inline bool is_subset(const isl::union_set &uset2) const;
4162   inline bool isa_set() const;
4163   inline isl::union_set lexmax() const;
4164   inline isl::union_set lexmin() const;
4165   inline isl::union_set polyhedral_hull() const;
4166   inline isl::union_set preimage(isl::multi_aff ma) const;
4167   inline isl::union_set preimage(isl::pw_multi_aff pma) const;
4168   inline isl::union_set preimage(isl::union_pw_multi_aff upma) const;
4169   inline isl::point sample_point() const;
4170   inline isl::set_list set_list() const;
4171   inline isl::set_list get_set_list() const;
4172   inline isl::space space() const;
4173   inline isl::space get_space() const;
4174   inline isl::union_set subtract(isl::union_set uset2) const;
4175   inline isl::union_set_list to_list() const;
4176   inline isl::union_set unite(isl::union_set uset2) const;
4177   inline isl::union_set universe() const;
4178   inline isl::union_map unwrap() const;
4179 };
4180 
4181 // declarations for isl::union_set_list
4182 inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4183 inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4184 
4185 class union_set_list {
4186   friend inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4187   friend inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4188 
4189 protected:
4190   isl_union_set_list *ptr = nullptr;
4191 
4192   inline explicit union_set_list(__isl_take isl_union_set_list *ptr);
4193 
4194 public:
4195   inline /* implicit */ union_set_list();
4196   inline /* implicit */ union_set_list(const union_set_list &obj);
4197   inline explicit union_set_list(isl::ctx ctx, int n);
4198   inline explicit union_set_list(isl::union_set el);
4199   inline explicit union_set_list(isl::ctx ctx, const std::string &str);
4200   inline union_set_list &operator=(union_set_list obj);
4201   inline ~union_set_list();
4202   inline __isl_give isl_union_set_list *copy() const &;
4203   inline __isl_give isl_union_set_list *copy() && = delete;
4204   inline __isl_keep isl_union_set_list *get() const;
4205   inline __isl_give isl_union_set_list *release();
4206   inline bool is_null() const;
4207   inline isl::ctx ctx() const;
4208 
4209   inline isl::union_set_list add(isl::union_set el) const;
4210   inline isl::union_set at(int index) const;
4211   inline isl::union_set get_at(int index) const;
4212   inline isl::union_set_list clear() const;
4213   inline isl::union_set_list concat(isl::union_set_list list2) const;
4214   inline isl::union_set_list drop(unsigned int first, unsigned int n) const;
4215   inline void foreach(const std::function<void(isl::union_set)> &fn) const;
4216   inline isl::union_set_list insert(unsigned int pos, isl::union_set el) const;
4217   inline unsigned size() const;
4218 };
4219 
4220 // declarations for isl::val
4221 inline val manage(__isl_take isl_val *ptr);
4222 inline val manage_copy(__isl_keep isl_val *ptr);
4223 
4224 class val {
4225   friend inline val manage(__isl_take isl_val *ptr);
4226   friend inline val manage_copy(__isl_keep isl_val *ptr);
4227 
4228 protected:
4229   isl_val *ptr = nullptr;
4230 
4231   inline explicit val(__isl_take isl_val *ptr);
4232 
4233 public:
4234   inline /* implicit */ val();
4235   inline /* implicit */ val(const val &obj);
4236   inline explicit val(isl::ctx ctx, long i);
4237   inline explicit val(isl::ctx ctx, const std::string &str);
4238   inline val &operator=(val obj);
4239   inline ~val();
4240   inline __isl_give isl_val *copy() const &;
4241   inline __isl_give isl_val *copy() && = delete;
4242   inline __isl_keep isl_val *get() const;
4243   inline __isl_give isl_val *release();
4244   inline bool is_null() const;
4245   inline isl::ctx ctx() const;
4246 
4247   inline isl::val abs() const;
4248   inline bool abs_eq(const isl::val &v2) const;
4249   inline bool abs_eq(long v2) const;
4250   inline isl::val add(isl::val v2) const;
4251   inline isl::val add(long v2) const;
4252   inline isl::val ceil() const;
4253   inline int cmp_si(long i) const;
4254   inline long den_si() const;
4255   inline long get_den_si() const;
4256   inline isl::val div(isl::val v2) const;
4257   inline isl::val div(long v2) const;
4258   inline bool eq(const isl::val &v2) const;
4259   inline bool eq(long v2) const;
4260   inline isl::val floor() const;
4261   inline isl::val gcd(isl::val v2) const;
4262   inline isl::val gcd(long v2) const;
4263   inline bool ge(const isl::val &v2) const;
4264   inline bool ge(long v2) const;
4265   inline bool gt(const isl::val &v2) const;
4266   inline bool gt(long v2) const;
4267   static inline isl::val infty(isl::ctx ctx);
4268   inline isl::val inv() const;
4269   inline bool is_divisible_by(const isl::val &v2) const;
4270   inline bool is_divisible_by(long v2) const;
4271   inline bool is_infty() const;
4272   inline bool is_int() const;
4273   inline bool is_nan() const;
4274   inline bool is_neg() const;
4275   inline bool is_neginfty() const;
4276   inline bool is_negone() const;
4277   inline bool is_nonneg() const;
4278   inline bool is_nonpos() const;
4279   inline bool is_one() const;
4280   inline bool is_pos() const;
4281   inline bool is_rat() const;
4282   inline bool is_zero() const;
4283   inline bool le(const isl::val &v2) const;
4284   inline bool le(long v2) const;
4285   inline bool lt(const isl::val &v2) const;
4286   inline bool lt(long v2) const;
4287   inline isl::val max(isl::val v2) const;
4288   inline isl::val max(long v2) const;
4289   inline isl::val min(isl::val v2) const;
4290   inline isl::val min(long v2) const;
4291   inline isl::val mod(isl::val v2) const;
4292   inline isl::val mod(long v2) const;
4293   inline isl::val mul(isl::val v2) const;
4294   inline isl::val mul(long v2) const;
4295   static inline isl::val nan(isl::ctx ctx);
4296   inline bool ne(const isl::val &v2) const;
4297   inline bool ne(long v2) const;
4298   inline isl::val neg() const;
4299   static inline isl::val neginfty(isl::ctx ctx);
4300   static inline isl::val negone(isl::ctx ctx);
4301   inline long num_si() const;
4302   inline long get_num_si() const;
4303   static inline isl::val one(isl::ctx ctx);
4304   inline isl::val pow2() const;
4305   inline int sgn() const;
4306   inline isl::val sub(isl::val v2) const;
4307   inline isl::val sub(long v2) const;
4308   inline isl::val_list to_list() const;
4309   inline isl::val trunc() const;
4310   static inline isl::val zero(isl::ctx ctx);
4311 };
4312 
4313 // declarations for isl::val_list
4314 inline val_list manage(__isl_take isl_val_list *ptr);
4315 inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4316 
4317 class val_list {
4318   friend inline val_list manage(__isl_take isl_val_list *ptr);
4319   friend inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4320 
4321 protected:
4322   isl_val_list *ptr = nullptr;
4323 
4324   inline explicit val_list(__isl_take isl_val_list *ptr);
4325 
4326 public:
4327   inline /* implicit */ val_list();
4328   inline /* implicit */ val_list(const val_list &obj);
4329   inline explicit val_list(isl::ctx ctx, int n);
4330   inline explicit val_list(isl::val el);
4331   inline explicit val_list(isl::ctx ctx, const std::string &str);
4332   inline val_list &operator=(val_list obj);
4333   inline ~val_list();
4334   inline __isl_give isl_val_list *copy() const &;
4335   inline __isl_give isl_val_list *copy() && = delete;
4336   inline __isl_keep isl_val_list *get() const;
4337   inline __isl_give isl_val_list *release();
4338   inline bool is_null() const;
4339   inline isl::ctx ctx() const;
4340 
4341   inline isl::val_list add(isl::val el) const;
4342   inline isl::val_list add(long el) const;
4343   inline isl::val at(int index) const;
4344   inline isl::val get_at(int index) const;
4345   inline isl::val_list clear() const;
4346   inline isl::val_list concat(isl::val_list list2) const;
4347   inline isl::val_list drop(unsigned int first, unsigned int n) const;
4348   inline void foreach(const std::function<void(isl::val)> &fn) const;
4349   inline isl::val_list insert(unsigned int pos, isl::val el) const;
4350   inline isl::val_list insert(unsigned int pos, long el) const;
4351   inline unsigned size() const;
4352 };
4353 
4354 // implementations for isl::aff
manage(__isl_take isl_aff * ptr)4355 aff manage(__isl_take isl_aff *ptr) {
4356   if (!ptr)
4357     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4358   return aff(ptr);
4359 }
manage_copy(__isl_keep isl_aff * ptr)4360 aff manage_copy(__isl_keep isl_aff *ptr) {
4361   if (!ptr)
4362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4363   auto saved_ctx = isl_aff_get_ctx(ptr);
4364   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4365   ptr = isl_aff_copy(ptr);
4366   if (!ptr)
4367     exception::throw_last_error(saved_ctx);
4368   return aff(ptr);
4369 }
4370 
aff()4371 aff::aff()
4372     : ptr(nullptr) {}
4373 
aff(const aff & obj)4374 aff::aff(const aff &obj)
4375     : ptr(nullptr)
4376 {
4377   if (!obj.ptr)
4378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4379   auto saved_ctx = isl_aff_get_ctx(obj.ptr);
4380   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4381   ptr = obj.copy();
4382   if (!ptr)
4383     exception::throw_last_error(saved_ctx);
4384 }
4385 
aff(__isl_take isl_aff * ptr)4386 aff::aff(__isl_take isl_aff *ptr)
4387     : ptr(ptr) {}
4388 
aff(isl::ctx ctx,const std::string & str)4389 aff::aff(isl::ctx ctx, const std::string &str)
4390 {
4391   auto saved_ctx = ctx;
4392   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4393   auto res = isl_aff_read_from_str(ctx.release(), str.c_str());
4394   if (!res)
4395     exception::throw_last_error(saved_ctx);
4396   ptr = res;
4397 }
4398 
4399 aff &aff::operator=(aff obj) {
4400   std::swap(this->ptr, obj.ptr);
4401   return *this;
4402 }
4403 
~aff()4404 aff::~aff() {
4405   if (ptr)
4406     isl_aff_free(ptr);
4407 }
4408 
copy()4409 __isl_give isl_aff *aff::copy() const & {
4410   return isl_aff_copy(ptr);
4411 }
4412 
get()4413 __isl_keep isl_aff *aff::get() const {
4414   return ptr;
4415 }
4416 
release()4417 __isl_give isl_aff *aff::release() {
4418   isl_aff *tmp = ptr;
4419   ptr = nullptr;
4420   return tmp;
4421 }
4422 
is_null()4423 bool aff::is_null() const {
4424   return ptr == nullptr;
4425 }
4426 
ctx()4427 isl::ctx aff::ctx() const {
4428   return isl::ctx(isl_aff_get_ctx(ptr));
4429 }
4430 
add(isl::aff aff2)4431 isl::aff aff::add(isl::aff aff2) const
4432 {
4433   if (!ptr || aff2.is_null())
4434     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4435   auto saved_ctx = ctx();
4436   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4437   auto res = isl_aff_add(copy(), aff2.release());
4438   if (!res)
4439     exception::throw_last_error(saved_ctx);
4440   return manage(res);
4441 }
4442 
add(const isl::multi_aff & multi2)4443 isl::multi_aff aff::add(const isl::multi_aff &multi2) const
4444 {
4445   if (!ptr)
4446     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4447   return isl::multi_aff(*this).add(multi2);
4448 }
4449 
add(const isl::multi_pw_aff & multi2)4450 isl::multi_pw_aff aff::add(const isl::multi_pw_aff &multi2) const
4451 {
4452   if (!ptr)
4453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4454   return isl::pw_aff(*this).add(multi2);
4455 }
4456 
add(const isl::multi_union_pw_aff & multi2)4457 isl::multi_union_pw_aff aff::add(const isl::multi_union_pw_aff &multi2) const
4458 {
4459   if (!ptr)
4460     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4461   return isl::pw_aff(*this).add(multi2);
4462 }
4463 
add(const isl::pw_aff & pwaff2)4464 isl::pw_aff aff::add(const isl::pw_aff &pwaff2) const
4465 {
4466   if (!ptr)
4467     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4468   return isl::pw_aff(*this).add(pwaff2);
4469 }
4470 
add(const isl::pw_multi_aff & pma2)4471 isl::pw_multi_aff aff::add(const isl::pw_multi_aff &pma2) const
4472 {
4473   if (!ptr)
4474     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4475   return isl::pw_aff(*this).add(pma2);
4476 }
4477 
add(const isl::union_pw_aff & upa2)4478 isl::union_pw_aff aff::add(const isl::union_pw_aff &upa2) const
4479 {
4480   if (!ptr)
4481     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4482   return isl::pw_aff(*this).add(upa2);
4483 }
4484 
add(const isl::union_pw_multi_aff & upma2)4485 isl::union_pw_multi_aff aff::add(const isl::union_pw_multi_aff &upma2) const
4486 {
4487   if (!ptr)
4488     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4489   return isl::pw_aff(*this).add(upma2);
4490 }
4491 
add_constant(isl::val v)4492 isl::aff aff::add_constant(isl::val v) const
4493 {
4494   if (!ptr || v.is_null())
4495     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4496   auto saved_ctx = ctx();
4497   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4498   auto res = isl_aff_add_constant_val(copy(), v.release());
4499   if (!res)
4500     exception::throw_last_error(saved_ctx);
4501   return manage(res);
4502 }
4503 
add_constant(long v)4504 isl::aff aff::add_constant(long v) const
4505 {
4506   if (!ptr)
4507     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4508   return this->add_constant(isl::val(ctx(), v));
4509 }
4510 
add_constant(const isl::multi_val & mv)4511 isl::multi_aff aff::add_constant(const isl::multi_val &mv) const
4512 {
4513   if (!ptr)
4514     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4515   return isl::multi_aff(*this).add_constant(mv);
4516 }
4517 
apply(const isl::union_pw_multi_aff & upma2)4518 isl::union_pw_multi_aff aff::apply(const isl::union_pw_multi_aff &upma2) const
4519 {
4520   if (!ptr)
4521     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4522   return isl::pw_aff(*this).apply(upma2);
4523 }
4524 
as_aff()4525 isl::aff aff::as_aff() const
4526 {
4527   if (!ptr)
4528     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4529   return isl::pw_aff(*this).as_aff();
4530 }
4531 
as_map()4532 isl::map aff::as_map() const
4533 {
4534   if (!ptr)
4535     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4536   return isl::pw_aff(*this).as_map();
4537 }
4538 
as_multi_aff()4539 isl::multi_aff aff::as_multi_aff() const
4540 {
4541   if (!ptr)
4542     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4543   return isl::pw_aff(*this).as_multi_aff();
4544 }
4545 
as_multi_union_pw_aff()4546 isl::multi_union_pw_aff aff::as_multi_union_pw_aff() const
4547 {
4548   if (!ptr)
4549     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4550   return isl::pw_aff(*this).as_multi_union_pw_aff();
4551 }
4552 
as_pw_multi_aff()4553 isl::pw_multi_aff aff::as_pw_multi_aff() const
4554 {
4555   if (!ptr)
4556     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4557   return isl::pw_aff(*this).as_pw_multi_aff();
4558 }
4559 
as_set()4560 isl::set aff::as_set() const
4561 {
4562   if (!ptr)
4563     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4564   return isl::multi_aff(*this).as_set();
4565 }
4566 
as_union_map()4567 isl::union_map aff::as_union_map() const
4568 {
4569   if (!ptr)
4570     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4571   return isl::pw_aff(*this).as_union_map();
4572 }
4573 
at(int pos)4574 isl::aff aff::at(int pos) const
4575 {
4576   if (!ptr)
4577     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4578   return isl::multi_aff(*this).at(pos);
4579 }
4580 
bind(isl::id id)4581 isl::basic_set aff::bind(isl::id id) const
4582 {
4583   if (!ptr || id.is_null())
4584     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4585   auto saved_ctx = ctx();
4586   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4587   auto res = isl_aff_bind_id(copy(), id.release());
4588   if (!res)
4589     exception::throw_last_error(saved_ctx);
4590   return manage(res);
4591 }
4592 
bind(const std::string & id)4593 isl::basic_set aff::bind(const std::string &id) const
4594 {
4595   if (!ptr)
4596     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4597   return this->bind(isl::id(ctx(), id));
4598 }
4599 
bind(const isl::multi_id & tuple)4600 isl::basic_set aff::bind(const isl::multi_id &tuple) const
4601 {
4602   if (!ptr)
4603     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4604   return isl::multi_aff(*this).bind(tuple);
4605 }
4606 
bind_domain(const isl::multi_id & tuple)4607 isl::pw_aff aff::bind_domain(const isl::multi_id &tuple) const
4608 {
4609   if (!ptr)
4610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4611   return isl::pw_aff(*this).bind_domain(tuple);
4612 }
4613 
bind_domain_wrapped_domain(const isl::multi_id & tuple)4614 isl::pw_aff aff::bind_domain_wrapped_domain(const isl::multi_id &tuple) const
4615 {
4616   if (!ptr)
4617     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4618   return isl::pw_aff(*this).bind_domain_wrapped_domain(tuple);
4619 }
4620 
ceil()4621 isl::aff aff::ceil() const
4622 {
4623   if (!ptr)
4624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4625   auto saved_ctx = ctx();
4626   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4627   auto res = isl_aff_ceil(copy());
4628   if (!res)
4629     exception::throw_last_error(saved_ctx);
4630   return manage(res);
4631 }
4632 
coalesce()4633 isl::pw_aff aff::coalesce() const
4634 {
4635   if (!ptr)
4636     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4637   return isl::pw_aff(*this).coalesce();
4638 }
4639 
cond(const isl::pw_aff & pwaff_true,const isl::pw_aff & pwaff_false)4640 isl::pw_aff aff::cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const
4641 {
4642   if (!ptr)
4643     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4644   return isl::pw_aff(*this).cond(pwaff_true, pwaff_false);
4645 }
4646 
constant_multi_val()4647 isl::multi_val aff::constant_multi_val() const
4648 {
4649   if (!ptr)
4650     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4651   return isl::multi_aff(*this).constant_multi_val();
4652 }
4653 
constant_val()4654 isl::val aff::constant_val() const
4655 {
4656   if (!ptr)
4657     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4658   auto saved_ctx = ctx();
4659   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4660   auto res = isl_aff_get_constant_val(get());
4661   if (!res)
4662     exception::throw_last_error(saved_ctx);
4663   return manage(res);
4664 }
4665 
get_constant_val()4666 isl::val aff::get_constant_val() const
4667 {
4668   return constant_val();
4669 }
4670 
div(isl::aff aff2)4671 isl::aff aff::div(isl::aff aff2) const
4672 {
4673   if (!ptr || aff2.is_null())
4674     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4675   auto saved_ctx = ctx();
4676   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4677   auto res = isl_aff_div(copy(), aff2.release());
4678   if (!res)
4679     exception::throw_last_error(saved_ctx);
4680   return manage(res);
4681 }
4682 
div(const isl::pw_aff & pa2)4683 isl::pw_aff aff::div(const isl::pw_aff &pa2) const
4684 {
4685   if (!ptr)
4686     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4687   return isl::pw_aff(*this).div(pa2);
4688 }
4689 
domain()4690 isl::set aff::domain() const
4691 {
4692   if (!ptr)
4693     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4694   return isl::pw_aff(*this).domain();
4695 }
4696 
eq_set(isl::aff aff2)4697 isl::set aff::eq_set(isl::aff aff2) const
4698 {
4699   if (!ptr || aff2.is_null())
4700     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4701   auto saved_ctx = ctx();
4702   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4703   auto res = isl_aff_eq_set(copy(), aff2.release());
4704   if (!res)
4705     exception::throw_last_error(saved_ctx);
4706   return manage(res);
4707 }
4708 
eq_set(const isl::pw_aff & pwaff2)4709 isl::set aff::eq_set(const isl::pw_aff &pwaff2) const
4710 {
4711   if (!ptr)
4712     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4713   return isl::pw_aff(*this).eq_set(pwaff2);
4714 }
4715 
eval(isl::point pnt)4716 isl::val aff::eval(isl::point pnt) const
4717 {
4718   if (!ptr || pnt.is_null())
4719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4720   auto saved_ctx = ctx();
4721   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4722   auto res = isl_aff_eval(copy(), pnt.release());
4723   if (!res)
4724     exception::throw_last_error(saved_ctx);
4725   return manage(res);
4726 }
4727 
extract_pw_multi_aff(const isl::space & space)4728 isl::pw_multi_aff aff::extract_pw_multi_aff(const isl::space &space) const
4729 {
4730   if (!ptr)
4731     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4732   return isl::pw_aff(*this).extract_pw_multi_aff(space);
4733 }
4734 
flat_range_product(const isl::multi_aff & multi2)4735 isl::multi_aff aff::flat_range_product(const isl::multi_aff &multi2) const
4736 {
4737   if (!ptr)
4738     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4739   return isl::multi_aff(*this).flat_range_product(multi2);
4740 }
4741 
flat_range_product(const isl::multi_pw_aff & multi2)4742 isl::multi_pw_aff aff::flat_range_product(const isl::multi_pw_aff &multi2) const
4743 {
4744   if (!ptr)
4745     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4746   return isl::pw_aff(*this).flat_range_product(multi2);
4747 }
4748 
flat_range_product(const isl::multi_union_pw_aff & multi2)4749 isl::multi_union_pw_aff aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
4750 {
4751   if (!ptr)
4752     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4753   return isl::pw_aff(*this).flat_range_product(multi2);
4754 }
4755 
flat_range_product(const isl::pw_multi_aff & pma2)4756 isl::pw_multi_aff aff::flat_range_product(const isl::pw_multi_aff &pma2) const
4757 {
4758   if (!ptr)
4759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4760   return isl::pw_aff(*this).flat_range_product(pma2);
4761 }
4762 
flat_range_product(const isl::union_pw_multi_aff & upma2)4763 isl::union_pw_multi_aff aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
4764 {
4765   if (!ptr)
4766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4767   return isl::pw_aff(*this).flat_range_product(upma2);
4768 }
4769 
floor()4770 isl::aff aff::floor() const
4771 {
4772   if (!ptr)
4773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4774   auto saved_ctx = ctx();
4775   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4776   auto res = isl_aff_floor(copy());
4777   if (!res)
4778     exception::throw_last_error(saved_ctx);
4779   return manage(res);
4780 }
4781 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)4782 void aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
4783 {
4784   if (!ptr)
4785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4786   return isl::pw_aff(*this).foreach_piece(fn);
4787 }
4788 
ge_set(isl::aff aff2)4789 isl::set aff::ge_set(isl::aff aff2) const
4790 {
4791   if (!ptr || aff2.is_null())
4792     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4793   auto saved_ctx = ctx();
4794   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4795   auto res = isl_aff_ge_set(copy(), aff2.release());
4796   if (!res)
4797     exception::throw_last_error(saved_ctx);
4798   return manage(res);
4799 }
4800 
ge_set(const isl::pw_aff & pwaff2)4801 isl::set aff::ge_set(const isl::pw_aff &pwaff2) const
4802 {
4803   if (!ptr)
4804     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4805   return isl::pw_aff(*this).ge_set(pwaff2);
4806 }
4807 
gist(isl::set context)4808 isl::aff aff::gist(isl::set context) const
4809 {
4810   if (!ptr || context.is_null())
4811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4812   auto saved_ctx = ctx();
4813   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4814   auto res = isl_aff_gist(copy(), context.release());
4815   if (!res)
4816     exception::throw_last_error(saved_ctx);
4817   return manage(res);
4818 }
4819 
gist(const isl::union_set & context)4820 isl::union_pw_aff aff::gist(const isl::union_set &context) const
4821 {
4822   if (!ptr)
4823     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4824   return isl::pw_aff(*this).gist(context);
4825 }
4826 
gist(const isl::basic_set & context)4827 isl::aff aff::gist(const isl::basic_set &context) const
4828 {
4829   if (!ptr)
4830     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4831   return this->gist(isl::set(context));
4832 }
4833 
gist(const isl::point & context)4834 isl::aff aff::gist(const isl::point &context) const
4835 {
4836   if (!ptr)
4837     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4838   return this->gist(isl::set(context));
4839 }
4840 
gt_set(isl::aff aff2)4841 isl::set aff::gt_set(isl::aff aff2) const
4842 {
4843   if (!ptr || aff2.is_null())
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_gt_set(copy(), aff2.release());
4848   if (!res)
4849     exception::throw_last_error(saved_ctx);
4850   return manage(res);
4851 }
4852 
gt_set(const isl::pw_aff & pwaff2)4853 isl::set aff::gt_set(const isl::pw_aff &pwaff2) const
4854 {
4855   if (!ptr)
4856     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4857   return isl::pw_aff(*this).gt_set(pwaff2);
4858 }
4859 
has_range_tuple_id()4860 bool aff::has_range_tuple_id() const
4861 {
4862   if (!ptr)
4863     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4864   return isl::multi_aff(*this).has_range_tuple_id();
4865 }
4866 
identity()4867 isl::multi_aff aff::identity() const
4868 {
4869   if (!ptr)
4870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4871   return isl::multi_aff(*this).identity();
4872 }
4873 
insert_domain(const isl::space & domain)4874 isl::pw_aff aff::insert_domain(const isl::space &domain) const
4875 {
4876   if (!ptr)
4877     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4878   return isl::pw_aff(*this).insert_domain(domain);
4879 }
4880 
intersect_domain(const isl::set & set)4881 isl::pw_aff aff::intersect_domain(const isl::set &set) const
4882 {
4883   if (!ptr)
4884     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4885   return isl::pw_aff(*this).intersect_domain(set);
4886 }
4887 
intersect_domain(const isl::space & space)4888 isl::union_pw_aff aff::intersect_domain(const isl::space &space) const
4889 {
4890   if (!ptr)
4891     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4892   return isl::pw_aff(*this).intersect_domain(space);
4893 }
4894 
intersect_domain(const isl::union_set & uset)4895 isl::union_pw_aff aff::intersect_domain(const isl::union_set &uset) const
4896 {
4897   if (!ptr)
4898     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4899   return isl::pw_aff(*this).intersect_domain(uset);
4900 }
4901 
intersect_domain_wrapped_domain(const isl::union_set & uset)4902 isl::union_pw_aff aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
4903 {
4904   if (!ptr)
4905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4906   return isl::pw_aff(*this).intersect_domain_wrapped_domain(uset);
4907 }
4908 
intersect_domain_wrapped_range(const isl::union_set & uset)4909 isl::union_pw_aff aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
4910 {
4911   if (!ptr)
4912     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4913   return isl::pw_aff(*this).intersect_domain_wrapped_range(uset);
4914 }
4915 
intersect_params(const isl::set & set)4916 isl::pw_aff aff::intersect_params(const isl::set &set) const
4917 {
4918   if (!ptr)
4919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4920   return isl::pw_aff(*this).intersect_params(set);
4921 }
4922 
involves_locals()4923 bool aff::involves_locals() const
4924 {
4925   if (!ptr)
4926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4927   return isl::multi_aff(*this).involves_locals();
4928 }
4929 
involves_nan()4930 bool aff::involves_nan() const
4931 {
4932   if (!ptr)
4933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4934   return isl::multi_aff(*this).involves_nan();
4935 }
4936 
involves_param(const isl::id & id)4937 bool aff::involves_param(const isl::id &id) const
4938 {
4939   if (!ptr)
4940     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4941   return isl::pw_aff(*this).involves_param(id);
4942 }
4943 
involves_param(const std::string & id)4944 bool aff::involves_param(const std::string &id) const
4945 {
4946   if (!ptr)
4947     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4948   return this->involves_param(isl::id(ctx(), id));
4949 }
4950 
involves_param(const isl::id_list & list)4951 bool aff::involves_param(const isl::id_list &list) const
4952 {
4953   if (!ptr)
4954     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4955   return isl::pw_aff(*this).involves_param(list);
4956 }
4957 
is_cst()4958 bool aff::is_cst() const
4959 {
4960   if (!ptr)
4961     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4962   auto saved_ctx = ctx();
4963   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4964   auto res = isl_aff_is_cst(get());
4965   if (res < 0)
4966     exception::throw_last_error(saved_ctx);
4967   return res;
4968 }
4969 
isa_aff()4970 bool aff::isa_aff() const
4971 {
4972   if (!ptr)
4973     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4974   return isl::pw_aff(*this).isa_aff();
4975 }
4976 
isa_multi_aff()4977 bool aff::isa_multi_aff() const
4978 {
4979   if (!ptr)
4980     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4981   return isl::pw_aff(*this).isa_multi_aff();
4982 }
4983 
isa_pw_multi_aff()4984 bool aff::isa_pw_multi_aff() const
4985 {
4986   if (!ptr)
4987     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4988   return isl::pw_aff(*this).isa_pw_multi_aff();
4989 }
4990 
le_set(isl::aff aff2)4991 isl::set aff::le_set(isl::aff aff2) const
4992 {
4993   if (!ptr || aff2.is_null())
4994     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4995   auto saved_ctx = ctx();
4996   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4997   auto res = isl_aff_le_set(copy(), aff2.release());
4998   if (!res)
4999     exception::throw_last_error(saved_ctx);
5000   return manage(res);
5001 }
5002 
le_set(const isl::pw_aff & pwaff2)5003 isl::set aff::le_set(const isl::pw_aff &pwaff2) const
5004 {
5005   if (!ptr)
5006     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5007   return isl::pw_aff(*this).le_set(pwaff2);
5008 }
5009 
list()5010 isl::aff_list aff::list() const
5011 {
5012   if (!ptr)
5013     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5014   return isl::multi_aff(*this).list();
5015 }
5016 
lt_set(isl::aff aff2)5017 isl::set aff::lt_set(isl::aff aff2) const
5018 {
5019   if (!ptr || aff2.is_null())
5020     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5021   auto saved_ctx = ctx();
5022   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5023   auto res = isl_aff_lt_set(copy(), aff2.release());
5024   if (!res)
5025     exception::throw_last_error(saved_ctx);
5026   return manage(res);
5027 }
5028 
lt_set(const isl::pw_aff & pwaff2)5029 isl::set aff::lt_set(const isl::pw_aff &pwaff2) const
5030 {
5031   if (!ptr)
5032     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5033   return isl::pw_aff(*this).lt_set(pwaff2);
5034 }
5035 
max(const isl::multi_pw_aff & multi2)5036 isl::multi_pw_aff aff::max(const isl::multi_pw_aff &multi2) const
5037 {
5038   if (!ptr)
5039     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5040   return isl::pw_aff(*this).max(multi2);
5041 }
5042 
max(const isl::pw_aff & pwaff2)5043 isl::pw_aff aff::max(const isl::pw_aff &pwaff2) const
5044 {
5045   if (!ptr)
5046     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5047   return isl::pw_aff(*this).max(pwaff2);
5048 }
5049 
max_multi_val()5050 isl::multi_val aff::max_multi_val() const
5051 {
5052   if (!ptr)
5053     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5054   return isl::pw_aff(*this).max_multi_val();
5055 }
5056 
min(const isl::multi_pw_aff & multi2)5057 isl::multi_pw_aff aff::min(const isl::multi_pw_aff &multi2) const
5058 {
5059   if (!ptr)
5060     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5061   return isl::pw_aff(*this).min(multi2);
5062 }
5063 
min(const isl::pw_aff & pwaff2)5064 isl::pw_aff aff::min(const isl::pw_aff &pwaff2) const
5065 {
5066   if (!ptr)
5067     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5068   return isl::pw_aff(*this).min(pwaff2);
5069 }
5070 
min_multi_val()5071 isl::multi_val aff::min_multi_val() const
5072 {
5073   if (!ptr)
5074     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5075   return isl::pw_aff(*this).min_multi_val();
5076 }
5077 
mod(isl::val mod)5078 isl::aff aff::mod(isl::val mod) const
5079 {
5080   if (!ptr || mod.is_null())
5081     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5082   auto saved_ctx = ctx();
5083   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5084   auto res = isl_aff_mod_val(copy(), mod.release());
5085   if (!res)
5086     exception::throw_last_error(saved_ctx);
5087   return manage(res);
5088 }
5089 
mod(long mod)5090 isl::aff aff::mod(long mod) const
5091 {
5092   if (!ptr)
5093     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5094   return this->mod(isl::val(ctx(), mod));
5095 }
5096 
mul(isl::aff aff2)5097 isl::aff aff::mul(isl::aff aff2) const
5098 {
5099   if (!ptr || aff2.is_null())
5100     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5101   auto saved_ctx = ctx();
5102   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5103   auto res = isl_aff_mul(copy(), aff2.release());
5104   if (!res)
5105     exception::throw_last_error(saved_ctx);
5106   return manage(res);
5107 }
5108 
mul(const isl::pw_aff & pwaff2)5109 isl::pw_aff aff::mul(const isl::pw_aff &pwaff2) const
5110 {
5111   if (!ptr)
5112     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5113   return isl::pw_aff(*this).mul(pwaff2);
5114 }
5115 
n_piece()5116 unsigned aff::n_piece() const
5117 {
5118   if (!ptr)
5119     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5120   return isl::pw_aff(*this).n_piece();
5121 }
5122 
ne_set(isl::aff aff2)5123 isl::set aff::ne_set(isl::aff aff2) const
5124 {
5125   if (!ptr || aff2.is_null())
5126     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5127   auto saved_ctx = ctx();
5128   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5129   auto res = isl_aff_ne_set(copy(), aff2.release());
5130   if (!res)
5131     exception::throw_last_error(saved_ctx);
5132   return manage(res);
5133 }
5134 
ne_set(const isl::pw_aff & pwaff2)5135 isl::set aff::ne_set(const isl::pw_aff &pwaff2) const
5136 {
5137   if (!ptr)
5138     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5139   return isl::pw_aff(*this).ne_set(pwaff2);
5140 }
5141 
neg()5142 isl::aff aff::neg() const
5143 {
5144   if (!ptr)
5145     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5146   auto saved_ctx = ctx();
5147   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5148   auto res = isl_aff_neg(copy());
5149   if (!res)
5150     exception::throw_last_error(saved_ctx);
5151   return manage(res);
5152 }
5153 
plain_is_empty()5154 bool aff::plain_is_empty() const
5155 {
5156   if (!ptr)
5157     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5158   return isl::pw_aff(*this).plain_is_empty();
5159 }
5160 
plain_is_equal(const isl::multi_aff & multi2)5161 bool aff::plain_is_equal(const isl::multi_aff &multi2) const
5162 {
5163   if (!ptr)
5164     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5165   return isl::multi_aff(*this).plain_is_equal(multi2);
5166 }
5167 
plain_is_equal(const isl::multi_pw_aff & multi2)5168 bool aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
5169 {
5170   if (!ptr)
5171     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5172   return isl::pw_aff(*this).plain_is_equal(multi2);
5173 }
5174 
plain_is_equal(const isl::multi_union_pw_aff & multi2)5175 bool aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
5176 {
5177   if (!ptr)
5178     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5179   return isl::pw_aff(*this).plain_is_equal(multi2);
5180 }
5181 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)5182 isl::pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
5183 {
5184   if (!ptr)
5185     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5186   return isl::pw_aff(*this).preimage_domain_wrapped_domain(pma2);
5187 }
5188 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)5189 isl::union_pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
5190 {
5191   if (!ptr)
5192     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5193   return isl::pw_aff(*this).preimage_domain_wrapped_domain(upma2);
5194 }
5195 
product(const isl::multi_aff & multi2)5196 isl::multi_aff aff::product(const isl::multi_aff &multi2) const
5197 {
5198   if (!ptr)
5199     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5200   return isl::multi_aff(*this).product(multi2);
5201 }
5202 
product(const isl::multi_pw_aff & multi2)5203 isl::multi_pw_aff aff::product(const isl::multi_pw_aff &multi2) const
5204 {
5205   if (!ptr)
5206     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5207   return isl::pw_aff(*this).product(multi2);
5208 }
5209 
product(const isl::pw_multi_aff & pma2)5210 isl::pw_multi_aff aff::product(const isl::pw_multi_aff &pma2) const
5211 {
5212   if (!ptr)
5213     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5214   return isl::pw_aff(*this).product(pma2);
5215 }
5216 
pullback(isl::multi_aff ma)5217 isl::aff aff::pullback(isl::multi_aff ma) const
5218 {
5219   if (!ptr || ma.is_null())
5220     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5221   auto saved_ctx = ctx();
5222   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5223   auto res = isl_aff_pullback_multi_aff(copy(), ma.release());
5224   if (!res)
5225     exception::throw_last_error(saved_ctx);
5226   return manage(res);
5227 }
5228 
pullback(const isl::multi_pw_aff & mpa)5229 isl::pw_aff aff::pullback(const isl::multi_pw_aff &mpa) const
5230 {
5231   if (!ptr)
5232     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5233   return isl::pw_aff(*this).pullback(mpa);
5234 }
5235 
pullback(const isl::pw_multi_aff & pma)5236 isl::pw_aff aff::pullback(const isl::pw_multi_aff &pma) const
5237 {
5238   if (!ptr)
5239     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5240   return isl::pw_aff(*this).pullback(pma);
5241 }
5242 
pullback(const isl::union_pw_multi_aff & upma)5243 isl::union_pw_aff aff::pullback(const isl::union_pw_multi_aff &upma) const
5244 {
5245   if (!ptr)
5246     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5247   return isl::pw_aff(*this).pullback(upma);
5248 }
5249 
pullback(const isl::aff & ma)5250 isl::aff aff::pullback(const isl::aff &ma) const
5251 {
5252   if (!ptr)
5253     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5254   return this->pullback(isl::multi_aff(ma));
5255 }
5256 
pw_multi_aff_list()5257 isl::pw_multi_aff_list aff::pw_multi_aff_list() const
5258 {
5259   if (!ptr)
5260     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5261   return isl::pw_aff(*this).pw_multi_aff_list();
5262 }
5263 
range_factor_domain()5264 isl::pw_multi_aff aff::range_factor_domain() const
5265 {
5266   if (!ptr)
5267     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5268   return isl::pw_aff(*this).range_factor_domain();
5269 }
5270 
range_factor_range()5271 isl::pw_multi_aff aff::range_factor_range() const
5272 {
5273   if (!ptr)
5274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5275   return isl::pw_aff(*this).range_factor_range();
5276 }
5277 
range_product(const isl::multi_aff & multi2)5278 isl::multi_aff aff::range_product(const isl::multi_aff &multi2) const
5279 {
5280   if (!ptr)
5281     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5282   return isl::multi_aff(*this).range_product(multi2);
5283 }
5284 
range_product(const isl::multi_pw_aff & multi2)5285 isl::multi_pw_aff aff::range_product(const isl::multi_pw_aff &multi2) const
5286 {
5287   if (!ptr)
5288     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5289   return isl::pw_aff(*this).range_product(multi2);
5290 }
5291 
range_product(const isl::multi_union_pw_aff & multi2)5292 isl::multi_union_pw_aff aff::range_product(const isl::multi_union_pw_aff &multi2) const
5293 {
5294   if (!ptr)
5295     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5296   return isl::pw_aff(*this).range_product(multi2);
5297 }
5298 
range_product(const isl::pw_multi_aff & pma2)5299 isl::pw_multi_aff aff::range_product(const isl::pw_multi_aff &pma2) const
5300 {
5301   if (!ptr)
5302     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5303   return isl::pw_aff(*this).range_product(pma2);
5304 }
5305 
range_product(const isl::union_pw_multi_aff & upma2)5306 isl::union_pw_multi_aff aff::range_product(const isl::union_pw_multi_aff &upma2) const
5307 {
5308   if (!ptr)
5309     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5310   return isl::pw_aff(*this).range_product(upma2);
5311 }
5312 
range_tuple_id()5313 isl::id aff::range_tuple_id() const
5314 {
5315   if (!ptr)
5316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5317   return isl::multi_aff(*this).range_tuple_id();
5318 }
5319 
reset_range_tuple_id()5320 isl::multi_aff aff::reset_range_tuple_id() const
5321 {
5322   if (!ptr)
5323     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5324   return isl::multi_aff(*this).reset_range_tuple_id();
5325 }
5326 
scale(isl::val v)5327 isl::aff aff::scale(isl::val v) const
5328 {
5329   if (!ptr || v.is_null())
5330     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5331   auto saved_ctx = ctx();
5332   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5333   auto res = isl_aff_scale_val(copy(), v.release());
5334   if (!res)
5335     exception::throw_last_error(saved_ctx);
5336   return manage(res);
5337 }
5338 
scale(long v)5339 isl::aff aff::scale(long v) const
5340 {
5341   if (!ptr)
5342     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5343   return this->scale(isl::val(ctx(), v));
5344 }
5345 
scale(const isl::multi_val & mv)5346 isl::multi_aff aff::scale(const isl::multi_val &mv) const
5347 {
5348   if (!ptr)
5349     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5350   return isl::multi_aff(*this).scale(mv);
5351 }
5352 
scale_down(isl::val v)5353 isl::aff aff::scale_down(isl::val v) const
5354 {
5355   if (!ptr || v.is_null())
5356     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5357   auto saved_ctx = ctx();
5358   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5359   auto res = isl_aff_scale_down_val(copy(), v.release());
5360   if (!res)
5361     exception::throw_last_error(saved_ctx);
5362   return manage(res);
5363 }
5364 
scale_down(long v)5365 isl::aff aff::scale_down(long v) const
5366 {
5367   if (!ptr)
5368     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5369   return this->scale_down(isl::val(ctx(), v));
5370 }
5371 
scale_down(const isl::multi_val & mv)5372 isl::multi_aff aff::scale_down(const isl::multi_val &mv) const
5373 {
5374   if (!ptr)
5375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5376   return isl::multi_aff(*this).scale_down(mv);
5377 }
5378 
set_at(int pos,const isl::aff & el)5379 isl::multi_aff aff::set_at(int pos, const isl::aff &el) const
5380 {
5381   if (!ptr)
5382     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5383   return isl::multi_aff(*this).set_at(pos, el);
5384 }
5385 
set_at(int pos,const isl::pw_aff & el)5386 isl::multi_pw_aff aff::set_at(int pos, const isl::pw_aff &el) const
5387 {
5388   if (!ptr)
5389     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5390   return isl::pw_aff(*this).set_at(pos, el);
5391 }
5392 
set_at(int pos,const isl::union_pw_aff & el)5393 isl::multi_union_pw_aff aff::set_at(int pos, const isl::union_pw_aff &el) const
5394 {
5395   if (!ptr)
5396     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5397   return isl::pw_aff(*this).set_at(pos, el);
5398 }
5399 
set_range_tuple(const isl::id & id)5400 isl::multi_aff aff::set_range_tuple(const isl::id &id) const
5401 {
5402   if (!ptr)
5403     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5404   return isl::multi_aff(*this).set_range_tuple(id);
5405 }
5406 
set_range_tuple(const std::string & id)5407 isl::multi_aff aff::set_range_tuple(const std::string &id) const
5408 {
5409   if (!ptr)
5410     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5411   return this->set_range_tuple(isl::id(ctx(), id));
5412 }
5413 
size()5414 unsigned aff::size() const
5415 {
5416   if (!ptr)
5417     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5418   return isl::multi_aff(*this).size();
5419 }
5420 
space()5421 isl::space aff::space() const
5422 {
5423   if (!ptr)
5424     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5425   return isl::pw_aff(*this).space();
5426 }
5427 
sub(isl::aff aff2)5428 isl::aff aff::sub(isl::aff aff2) const
5429 {
5430   if (!ptr || aff2.is_null())
5431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5432   auto saved_ctx = ctx();
5433   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5434   auto res = isl_aff_sub(copy(), aff2.release());
5435   if (!res)
5436     exception::throw_last_error(saved_ctx);
5437   return manage(res);
5438 }
5439 
sub(const isl::multi_aff & multi2)5440 isl::multi_aff aff::sub(const isl::multi_aff &multi2) const
5441 {
5442   if (!ptr)
5443     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5444   return isl::multi_aff(*this).sub(multi2);
5445 }
5446 
sub(const isl::multi_pw_aff & multi2)5447 isl::multi_pw_aff aff::sub(const isl::multi_pw_aff &multi2) const
5448 {
5449   if (!ptr)
5450     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5451   return isl::pw_aff(*this).sub(multi2);
5452 }
5453 
sub(const isl::multi_union_pw_aff & multi2)5454 isl::multi_union_pw_aff aff::sub(const isl::multi_union_pw_aff &multi2) const
5455 {
5456   if (!ptr)
5457     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5458   return isl::pw_aff(*this).sub(multi2);
5459 }
5460 
sub(const isl::pw_aff & pwaff2)5461 isl::pw_aff aff::sub(const isl::pw_aff &pwaff2) const
5462 {
5463   if (!ptr)
5464     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5465   return isl::pw_aff(*this).sub(pwaff2);
5466 }
5467 
sub(const isl::pw_multi_aff & pma2)5468 isl::pw_multi_aff aff::sub(const isl::pw_multi_aff &pma2) const
5469 {
5470   if (!ptr)
5471     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5472   return isl::pw_aff(*this).sub(pma2);
5473 }
5474 
sub(const isl::union_pw_aff & upa2)5475 isl::union_pw_aff aff::sub(const isl::union_pw_aff &upa2) const
5476 {
5477   if (!ptr)
5478     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5479   return isl::pw_aff(*this).sub(upa2);
5480 }
5481 
sub(const isl::union_pw_multi_aff & upma2)5482 isl::union_pw_multi_aff aff::sub(const isl::union_pw_multi_aff &upma2) const
5483 {
5484   if (!ptr)
5485     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5486   return isl::pw_aff(*this).sub(upma2);
5487 }
5488 
subtract_domain(const isl::set & set)5489 isl::pw_aff aff::subtract_domain(const isl::set &set) const
5490 {
5491   if (!ptr)
5492     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5493   return isl::pw_aff(*this).subtract_domain(set);
5494 }
5495 
subtract_domain(const isl::space & space)5496 isl::union_pw_aff aff::subtract_domain(const isl::space &space) const
5497 {
5498   if (!ptr)
5499     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5500   return isl::pw_aff(*this).subtract_domain(space);
5501 }
5502 
subtract_domain(const isl::union_set & uset)5503 isl::union_pw_aff aff::subtract_domain(const isl::union_set &uset) const
5504 {
5505   if (!ptr)
5506     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5507   return isl::pw_aff(*this).subtract_domain(uset);
5508 }
5509 
tdiv_q(const isl::pw_aff & pa2)5510 isl::pw_aff aff::tdiv_q(const isl::pw_aff &pa2) const
5511 {
5512   if (!ptr)
5513     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5514   return isl::pw_aff(*this).tdiv_q(pa2);
5515 }
5516 
tdiv_r(const isl::pw_aff & pa2)5517 isl::pw_aff aff::tdiv_r(const isl::pw_aff &pa2) const
5518 {
5519   if (!ptr)
5520     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5521   return isl::pw_aff(*this).tdiv_r(pa2);
5522 }
5523 
to_list()5524 isl::aff_list aff::to_list() const
5525 {
5526   if (!ptr)
5527     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5528   auto saved_ctx = ctx();
5529   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5530   auto res = isl_aff_to_list(copy());
5531   if (!res)
5532     exception::throw_last_error(saved_ctx);
5533   return manage(res);
5534 }
5535 
to_multi_pw_aff()5536 isl::multi_pw_aff aff::to_multi_pw_aff() const
5537 {
5538   if (!ptr)
5539     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5540   return isl::multi_aff(*this).to_multi_pw_aff();
5541 }
5542 
to_multi_union_pw_aff()5543 isl::multi_union_pw_aff aff::to_multi_union_pw_aff() const
5544 {
5545   if (!ptr)
5546     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5547   return isl::multi_aff(*this).to_multi_union_pw_aff();
5548 }
5549 
to_pw_multi_aff()5550 isl::pw_multi_aff aff::to_pw_multi_aff() const
5551 {
5552   if (!ptr)
5553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5554   return isl::multi_aff(*this).to_pw_multi_aff();
5555 }
5556 
to_union_pw_aff()5557 isl::union_pw_aff aff::to_union_pw_aff() const
5558 {
5559   if (!ptr)
5560     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5561   return isl::pw_aff(*this).to_union_pw_aff();
5562 }
5563 
to_union_pw_multi_aff()5564 isl::union_pw_multi_aff aff::to_union_pw_multi_aff() const
5565 {
5566   if (!ptr)
5567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5568   return isl::pw_aff(*this).to_union_pw_multi_aff();
5569 }
5570 
unbind_params_insert_domain(isl::multi_id domain)5571 isl::aff aff::unbind_params_insert_domain(isl::multi_id domain) const
5572 {
5573   if (!ptr || domain.is_null())
5574     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5575   auto saved_ctx = ctx();
5576   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5577   auto res = isl_aff_unbind_params_insert_domain(copy(), domain.release());
5578   if (!res)
5579     exception::throw_last_error(saved_ctx);
5580   return manage(res);
5581 }
5582 
union_add(const isl::multi_pw_aff & mpa2)5583 isl::multi_pw_aff aff::union_add(const isl::multi_pw_aff &mpa2) const
5584 {
5585   if (!ptr)
5586     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5587   return isl::pw_aff(*this).union_add(mpa2);
5588 }
5589 
union_add(const isl::multi_union_pw_aff & mupa2)5590 isl::multi_union_pw_aff aff::union_add(const isl::multi_union_pw_aff &mupa2) const
5591 {
5592   if (!ptr)
5593     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5594   return isl::pw_aff(*this).union_add(mupa2);
5595 }
5596 
union_add(const isl::pw_aff & pwaff2)5597 isl::pw_aff aff::union_add(const isl::pw_aff &pwaff2) const
5598 {
5599   if (!ptr)
5600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5601   return isl::pw_aff(*this).union_add(pwaff2);
5602 }
5603 
union_add(const isl::pw_multi_aff & pma2)5604 isl::pw_multi_aff aff::union_add(const isl::pw_multi_aff &pma2) const
5605 {
5606   if (!ptr)
5607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5608   return isl::pw_aff(*this).union_add(pma2);
5609 }
5610 
union_add(const isl::union_pw_aff & upa2)5611 isl::union_pw_aff aff::union_add(const isl::union_pw_aff &upa2) const
5612 {
5613   if (!ptr)
5614     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5615   return isl::pw_aff(*this).union_add(upa2);
5616 }
5617 
union_add(const isl::union_pw_multi_aff & upma2)5618 isl::union_pw_multi_aff aff::union_add(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).union_add(upma2);
5623 }
5624 
zero_on_domain(isl::space space)5625 isl::aff aff::zero_on_domain(isl::space space)
5626 {
5627   if (space.is_null())
5628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5629   auto saved_ctx = space.ctx();
5630   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5631   auto res = isl_aff_zero_on_domain_space(space.release());
5632   if (!res)
5633     exception::throw_last_error(saved_ctx);
5634   return manage(res);
5635 }
5636 
5637 inline std::ostream &operator<<(std::ostream &os, const aff &obj)
5638 {
5639   if (!obj.get())
5640     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5641   auto saved_ctx = isl_aff_get_ctx(obj.get());
5642   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5643   char *str = isl_aff_to_str(obj.get());
5644   if (!str)
5645     exception::throw_last_error(saved_ctx);
5646   os << str;
5647   free(str);
5648   return os;
5649 }
5650 
5651 // implementations for isl::aff_list
manage(__isl_take isl_aff_list * ptr)5652 aff_list manage(__isl_take isl_aff_list *ptr) {
5653   if (!ptr)
5654     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5655   return aff_list(ptr);
5656 }
manage_copy(__isl_keep isl_aff_list * ptr)5657 aff_list manage_copy(__isl_keep isl_aff_list *ptr) {
5658   if (!ptr)
5659     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5660   auto saved_ctx = isl_aff_list_get_ctx(ptr);
5661   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5662   ptr = isl_aff_list_copy(ptr);
5663   if (!ptr)
5664     exception::throw_last_error(saved_ctx);
5665   return aff_list(ptr);
5666 }
5667 
aff_list()5668 aff_list::aff_list()
5669     : ptr(nullptr) {}
5670 
aff_list(const aff_list & obj)5671 aff_list::aff_list(const aff_list &obj)
5672     : ptr(nullptr)
5673 {
5674   if (!obj.ptr)
5675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5676   auto saved_ctx = isl_aff_list_get_ctx(obj.ptr);
5677   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5678   ptr = obj.copy();
5679   if (!ptr)
5680     exception::throw_last_error(saved_ctx);
5681 }
5682 
aff_list(__isl_take isl_aff_list * ptr)5683 aff_list::aff_list(__isl_take isl_aff_list *ptr)
5684     : ptr(ptr) {}
5685 
aff_list(isl::ctx ctx,int n)5686 aff_list::aff_list(isl::ctx ctx, int n)
5687 {
5688   auto saved_ctx = ctx;
5689   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5690   auto res = isl_aff_list_alloc(ctx.release(), n);
5691   if (!res)
5692     exception::throw_last_error(saved_ctx);
5693   ptr = res;
5694 }
5695 
aff_list(isl::aff el)5696 aff_list::aff_list(isl::aff el)
5697 {
5698   if (el.is_null())
5699     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5700   auto saved_ctx = el.ctx();
5701   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5702   auto res = isl_aff_list_from_aff(el.release());
5703   if (!res)
5704     exception::throw_last_error(saved_ctx);
5705   ptr = res;
5706 }
5707 
aff_list(isl::ctx ctx,const std::string & str)5708 aff_list::aff_list(isl::ctx ctx, const std::string &str)
5709 {
5710   auto saved_ctx = ctx;
5711   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5712   auto res = isl_aff_list_read_from_str(ctx.release(), str.c_str());
5713   if (!res)
5714     exception::throw_last_error(saved_ctx);
5715   ptr = res;
5716 }
5717 
5718 aff_list &aff_list::operator=(aff_list obj) {
5719   std::swap(this->ptr, obj.ptr);
5720   return *this;
5721 }
5722 
~aff_list()5723 aff_list::~aff_list() {
5724   if (ptr)
5725     isl_aff_list_free(ptr);
5726 }
5727 
copy()5728 __isl_give isl_aff_list *aff_list::copy() const & {
5729   return isl_aff_list_copy(ptr);
5730 }
5731 
get()5732 __isl_keep isl_aff_list *aff_list::get() const {
5733   return ptr;
5734 }
5735 
release()5736 __isl_give isl_aff_list *aff_list::release() {
5737   isl_aff_list *tmp = ptr;
5738   ptr = nullptr;
5739   return tmp;
5740 }
5741 
is_null()5742 bool aff_list::is_null() const {
5743   return ptr == nullptr;
5744 }
5745 
ctx()5746 isl::ctx aff_list::ctx() const {
5747   return isl::ctx(isl_aff_list_get_ctx(ptr));
5748 }
5749 
add(isl::aff el)5750 isl::aff_list aff_list::add(isl::aff el) const
5751 {
5752   if (!ptr || el.is_null())
5753     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5754   auto saved_ctx = ctx();
5755   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5756   auto res = isl_aff_list_add(copy(), el.release());
5757   if (!res)
5758     exception::throw_last_error(saved_ctx);
5759   return manage(res);
5760 }
5761 
at(int index)5762 isl::aff aff_list::at(int index) const
5763 {
5764   if (!ptr)
5765     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5766   auto saved_ctx = ctx();
5767   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5768   auto res = isl_aff_list_get_at(get(), index);
5769   if (!res)
5770     exception::throw_last_error(saved_ctx);
5771   return manage(res);
5772 }
5773 
get_at(int index)5774 isl::aff aff_list::get_at(int index) const
5775 {
5776   return at(index);
5777 }
5778 
clear()5779 isl::aff_list aff_list::clear() const
5780 {
5781   if (!ptr)
5782     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5783   auto saved_ctx = ctx();
5784   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5785   auto res = isl_aff_list_clear(copy());
5786   if (!res)
5787     exception::throw_last_error(saved_ctx);
5788   return manage(res);
5789 }
5790 
concat(isl::aff_list list2)5791 isl::aff_list aff_list::concat(isl::aff_list list2) const
5792 {
5793   if (!ptr || list2.is_null())
5794     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5795   auto saved_ctx = ctx();
5796   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5797   auto res = isl_aff_list_concat(copy(), list2.release());
5798   if (!res)
5799     exception::throw_last_error(saved_ctx);
5800   return manage(res);
5801 }
5802 
drop(unsigned int first,unsigned int n)5803 isl::aff_list aff_list::drop(unsigned int first, unsigned int n) const
5804 {
5805   if (!ptr)
5806     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5807   auto saved_ctx = ctx();
5808   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5809   auto res = isl_aff_list_drop(copy(), first, n);
5810   if (!res)
5811     exception::throw_last_error(saved_ctx);
5812   return manage(res);
5813 }
5814 
foreach(const std::function<void (isl::aff)> & fn)5815 void aff_list::foreach(const std::function<void(isl::aff)> &fn) const
5816 {
5817   if (!ptr)
5818     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5819   auto saved_ctx = ctx();
5820   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5821   struct fn_data {
5822     std::function<void(isl::aff)> func;
5823     std::exception_ptr eptr;
5824   } fn_data = { fn };
5825   auto fn_lambda = [](isl_aff *arg_0, void *arg_1) -> isl_stat {
5826     auto *data = static_cast<struct fn_data *>(arg_1);
5827     ISL_CPP_TRY {
5828       (data->func)(manage(arg_0));
5829       return isl_stat_ok;
5830     } ISL_CPP_CATCH_ALL {
5831       data->eptr = std::current_exception();
5832       return isl_stat_error;
5833     }
5834   };
5835   auto res = isl_aff_list_foreach(get(), fn_lambda, &fn_data);
5836   if (fn_data.eptr)
5837     std::rethrow_exception(fn_data.eptr);
5838   if (res < 0)
5839     exception::throw_last_error(saved_ctx);
5840   return;
5841 }
5842 
insert(unsigned int pos,isl::aff el)5843 isl::aff_list aff_list::insert(unsigned int pos, isl::aff el) const
5844 {
5845   if (!ptr || el.is_null())
5846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5847   auto saved_ctx = ctx();
5848   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5849   auto res = isl_aff_list_insert(copy(), pos, el.release());
5850   if (!res)
5851     exception::throw_last_error(saved_ctx);
5852   return manage(res);
5853 }
5854 
size()5855 unsigned aff_list::size() const
5856 {
5857   if (!ptr)
5858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5859   auto saved_ctx = ctx();
5860   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5861   auto res = isl_aff_list_size(get());
5862   if (res < 0)
5863     exception::throw_last_error(saved_ctx);
5864   return res;
5865 }
5866 
5867 inline std::ostream &operator<<(std::ostream &os, const aff_list &obj)
5868 {
5869   if (!obj.get())
5870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5871   auto saved_ctx = isl_aff_list_get_ctx(obj.get());
5872   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5873   char *str = isl_aff_list_to_str(obj.get());
5874   if (!str)
5875     exception::throw_last_error(saved_ctx);
5876   os << str;
5877   free(str);
5878   return os;
5879 }
5880 
5881 // implementations for isl::ast_build
manage(__isl_take isl_ast_build * ptr)5882 ast_build manage(__isl_take isl_ast_build *ptr) {
5883   if (!ptr)
5884     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5885   return ast_build(ptr);
5886 }
manage_copy(__isl_keep isl_ast_build * ptr)5887 ast_build manage_copy(__isl_keep isl_ast_build *ptr) {
5888   if (!ptr)
5889     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5890   auto saved_ctx = isl_ast_build_get_ctx(ptr);
5891   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5892   ptr = isl_ast_build_copy(ptr);
5893   if (!ptr)
5894     exception::throw_last_error(saved_ctx);
5895   return ast_build(ptr);
5896 }
5897 
ast_build()5898 ast_build::ast_build()
5899     : ptr(nullptr) {}
5900 
ast_build(const ast_build & obj)5901 ast_build::ast_build(const ast_build &obj)
5902     : ptr(nullptr)
5903 {
5904   if (!obj.ptr)
5905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5906   auto saved_ctx = isl_ast_build_get_ctx(obj.ptr);
5907   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5908   ptr = obj.copy();
5909   copy_callbacks(obj);
5910   if (!ptr)
5911     exception::throw_last_error(saved_ctx);
5912 }
5913 
ast_build(__isl_take isl_ast_build * ptr)5914 ast_build::ast_build(__isl_take isl_ast_build *ptr)
5915     : ptr(ptr) {}
5916 
ast_build(isl::ctx ctx)5917 ast_build::ast_build(isl::ctx ctx)
5918 {
5919   auto saved_ctx = ctx;
5920   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5921   auto res = isl_ast_build_alloc(ctx.release());
5922   if (!res)
5923     exception::throw_last_error(saved_ctx);
5924   ptr = res;
5925 }
5926 
5927 ast_build &ast_build::operator=(ast_build obj) {
5928   std::swap(this->ptr, obj.ptr);
5929   copy_callbacks(obj);
5930   return *this;
5931 }
5932 
~ast_build()5933 ast_build::~ast_build() {
5934   if (ptr)
5935     isl_ast_build_free(ptr);
5936 }
5937 
copy()5938 __isl_give isl_ast_build *ast_build::copy() const & {
5939   return isl_ast_build_copy(ptr);
5940 }
5941 
get()5942 __isl_keep isl_ast_build *ast_build::get() const {
5943   return ptr;
5944 }
5945 
release()5946 __isl_give isl_ast_build *ast_build::release() {
5947   if (at_each_domain_data)
5948     exception::throw_invalid("cannot release object with persistent callbacks", __FILE__, __LINE__);
5949   isl_ast_build *tmp = ptr;
5950   ptr = nullptr;
5951   return tmp;
5952 }
5953 
is_null()5954 bool ast_build::is_null() const {
5955   return ptr == nullptr;
5956 }
5957 
ctx()5958 isl::ctx ast_build::ctx() const {
5959   return isl::ctx(isl_ast_build_get_ctx(ptr));
5960 }
5961 
copy_callbacks(const ast_build & obj)5962 ast_build &ast_build::copy_callbacks(const ast_build &obj)
5963 {
5964   at_each_domain_data = obj.at_each_domain_data;
5965   return *this;
5966 }
5967 
at_each_domain(isl_ast_node * arg_0,isl_ast_build * arg_1,void * arg_2)5968 isl_ast_node *ast_build::at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2)
5969 {
5970   auto *data = static_cast<struct at_each_domain_data *>(arg_2);
5971   ISL_CPP_TRY {
5972     auto ret = (data->func)(manage(arg_0), manage_copy(arg_1));
5973     return ret.release();
5974   } ISL_CPP_CATCH_ALL {
5975     data->eptr = std::current_exception();
5976     return NULL;
5977   }
5978 }
5979 
set_at_each_domain_data(const std::function<isl::ast_node (isl::ast_node,isl::ast_build)> & fn)5980 void ast_build::set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn)
5981 {
5982   if (!ptr)
5983     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5984   auto saved_ctx = isl_ast_build_get_ctx(ptr);
5985   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5986   at_each_domain_data = std::make_shared<struct at_each_domain_data>();
5987   at_each_domain_data->func = fn;
5988   ptr = isl_ast_build_set_at_each_domain(ptr, &at_each_domain, at_each_domain_data.get());
5989   if (!ptr)
5990     exception::throw_last_error(saved_ctx);
5991 }
5992 
set_at_each_domain(const std::function<isl::ast_node (isl::ast_node,isl::ast_build)> & fn)5993 isl::ast_build ast_build::set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const
5994 {
5995   auto copy = *this;
5996   copy.set_at_each_domain_data(fn);
5997   return copy;
5998 }
5999 
access_from(isl::multi_pw_aff mpa)6000 isl::ast_expr ast_build::access_from(isl::multi_pw_aff mpa) const
6001 {
6002   if (!ptr || mpa.is_null())
6003     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6004   auto saved_ctx = ctx();
6005   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6006   auto res = isl_ast_build_access_from_multi_pw_aff(get(), mpa.release());
6007   if (at_each_domain_data && at_each_domain_data->eptr) {
6008     std::exception_ptr eptr = at_each_domain_data->eptr;
6009     at_each_domain_data->eptr = nullptr;
6010     std::rethrow_exception(eptr);
6011   }
6012   if (!res)
6013     exception::throw_last_error(saved_ctx);
6014   return manage(res);
6015 }
6016 
access_from(isl::pw_multi_aff pma)6017 isl::ast_expr ast_build::access_from(isl::pw_multi_aff pma) const
6018 {
6019   if (!ptr || pma.is_null())
6020     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6021   auto saved_ctx = ctx();
6022   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6023   auto res = isl_ast_build_access_from_pw_multi_aff(get(), pma.release());
6024   if (at_each_domain_data && at_each_domain_data->eptr) {
6025     std::exception_ptr eptr = at_each_domain_data->eptr;
6026     at_each_domain_data->eptr = nullptr;
6027     std::rethrow_exception(eptr);
6028   }
6029   if (!res)
6030     exception::throw_last_error(saved_ctx);
6031   return manage(res);
6032 }
6033 
call_from(isl::multi_pw_aff mpa)6034 isl::ast_expr ast_build::call_from(isl::multi_pw_aff mpa) const
6035 {
6036   if (!ptr || mpa.is_null())
6037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6038   auto saved_ctx = ctx();
6039   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6040   auto res = isl_ast_build_call_from_multi_pw_aff(get(), mpa.release());
6041   if (at_each_domain_data && at_each_domain_data->eptr) {
6042     std::exception_ptr eptr = at_each_domain_data->eptr;
6043     at_each_domain_data->eptr = nullptr;
6044     std::rethrow_exception(eptr);
6045   }
6046   if (!res)
6047     exception::throw_last_error(saved_ctx);
6048   return manage(res);
6049 }
6050 
call_from(isl::pw_multi_aff pma)6051 isl::ast_expr ast_build::call_from(isl::pw_multi_aff pma) const
6052 {
6053   if (!ptr || pma.is_null())
6054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6055   auto saved_ctx = ctx();
6056   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6057   auto res = isl_ast_build_call_from_pw_multi_aff(get(), pma.release());
6058   if (at_each_domain_data && at_each_domain_data->eptr) {
6059     std::exception_ptr eptr = at_each_domain_data->eptr;
6060     at_each_domain_data->eptr = nullptr;
6061     std::rethrow_exception(eptr);
6062   }
6063   if (!res)
6064     exception::throw_last_error(saved_ctx);
6065   return manage(res);
6066 }
6067 
expr_from(isl::pw_aff pa)6068 isl::ast_expr ast_build::expr_from(isl::pw_aff pa) const
6069 {
6070   if (!ptr || pa.is_null())
6071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6072   auto saved_ctx = ctx();
6073   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6074   auto res = isl_ast_build_expr_from_pw_aff(get(), pa.release());
6075   if (at_each_domain_data && at_each_domain_data->eptr) {
6076     std::exception_ptr eptr = at_each_domain_data->eptr;
6077     at_each_domain_data->eptr = nullptr;
6078     std::rethrow_exception(eptr);
6079   }
6080   if (!res)
6081     exception::throw_last_error(saved_ctx);
6082   return manage(res);
6083 }
6084 
expr_from(isl::set set)6085 isl::ast_expr ast_build::expr_from(isl::set set) const
6086 {
6087   if (!ptr || set.is_null())
6088     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6089   auto saved_ctx = ctx();
6090   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6091   auto res = isl_ast_build_expr_from_set(get(), set.release());
6092   if (at_each_domain_data && at_each_domain_data->eptr) {
6093     std::exception_ptr eptr = at_each_domain_data->eptr;
6094     at_each_domain_data->eptr = nullptr;
6095     std::rethrow_exception(eptr);
6096   }
6097   if (!res)
6098     exception::throw_last_error(saved_ctx);
6099   return manage(res);
6100 }
6101 
from_context(isl::set set)6102 isl::ast_build ast_build::from_context(isl::set set)
6103 {
6104   if (set.is_null())
6105     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6106   auto saved_ctx = set.ctx();
6107   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6108   auto res = isl_ast_build_from_context(set.release());
6109   if (!res)
6110     exception::throw_last_error(saved_ctx);
6111   return manage(res);
6112 }
6113 
node_from(isl::schedule schedule)6114 isl::ast_node ast_build::node_from(isl::schedule schedule) const
6115 {
6116   if (!ptr || schedule.is_null())
6117     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6118   auto saved_ctx = ctx();
6119   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6120   auto res = isl_ast_build_node_from_schedule(get(), schedule.release());
6121   if (at_each_domain_data && at_each_domain_data->eptr) {
6122     std::exception_ptr eptr = at_each_domain_data->eptr;
6123     at_each_domain_data->eptr = nullptr;
6124     std::rethrow_exception(eptr);
6125   }
6126   if (!res)
6127     exception::throw_last_error(saved_ctx);
6128   return manage(res);
6129 }
6130 
node_from_schedule_map(isl::union_map schedule)6131 isl::ast_node ast_build::node_from_schedule_map(isl::union_map schedule) const
6132 {
6133   if (!ptr || schedule.is_null())
6134     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6135   auto saved_ctx = ctx();
6136   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6137   auto res = isl_ast_build_node_from_schedule_map(get(), schedule.release());
6138   if (at_each_domain_data && at_each_domain_data->eptr) {
6139     std::exception_ptr eptr = at_each_domain_data->eptr;
6140     at_each_domain_data->eptr = nullptr;
6141     std::rethrow_exception(eptr);
6142   }
6143   if (!res)
6144     exception::throw_last_error(saved_ctx);
6145   return manage(res);
6146 }
6147 
schedule()6148 isl::union_map ast_build::schedule() const
6149 {
6150   if (!ptr)
6151     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6152   auto saved_ctx = ctx();
6153   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6154   auto res = isl_ast_build_get_schedule(get());
6155   if (at_each_domain_data && at_each_domain_data->eptr) {
6156     std::exception_ptr eptr = at_each_domain_data->eptr;
6157     at_each_domain_data->eptr = nullptr;
6158     std::rethrow_exception(eptr);
6159   }
6160   if (!res)
6161     exception::throw_last_error(saved_ctx);
6162   return manage(res);
6163 }
6164 
get_schedule()6165 isl::union_map ast_build::get_schedule() const
6166 {
6167   return schedule();
6168 }
6169 
6170 // implementations for isl::ast_expr
manage(__isl_take isl_ast_expr * ptr)6171 ast_expr manage(__isl_take isl_ast_expr *ptr) {
6172   if (!ptr)
6173     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6174   return ast_expr(ptr);
6175 }
manage_copy(__isl_keep isl_ast_expr * ptr)6176 ast_expr manage_copy(__isl_keep isl_ast_expr *ptr) {
6177   if (!ptr)
6178     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6179   auto saved_ctx = isl_ast_expr_get_ctx(ptr);
6180   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6181   ptr = isl_ast_expr_copy(ptr);
6182   if (!ptr)
6183     exception::throw_last_error(saved_ctx);
6184   return ast_expr(ptr);
6185 }
6186 
ast_expr()6187 ast_expr::ast_expr()
6188     : ptr(nullptr) {}
6189 
ast_expr(const ast_expr & obj)6190 ast_expr::ast_expr(const ast_expr &obj)
6191     : ptr(nullptr)
6192 {
6193   if (!obj.ptr)
6194     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6195   auto saved_ctx = isl_ast_expr_get_ctx(obj.ptr);
6196   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6197   ptr = obj.copy();
6198   if (!ptr)
6199     exception::throw_last_error(saved_ctx);
6200 }
6201 
ast_expr(__isl_take isl_ast_expr * ptr)6202 ast_expr::ast_expr(__isl_take isl_ast_expr *ptr)
6203     : ptr(ptr) {}
6204 
6205 ast_expr &ast_expr::operator=(ast_expr obj) {
6206   std::swap(this->ptr, obj.ptr);
6207   return *this;
6208 }
6209 
~ast_expr()6210 ast_expr::~ast_expr() {
6211   if (ptr)
6212     isl_ast_expr_free(ptr);
6213 }
6214 
copy()6215 __isl_give isl_ast_expr *ast_expr::copy() const & {
6216   return isl_ast_expr_copy(ptr);
6217 }
6218 
get()6219 __isl_keep isl_ast_expr *ast_expr::get() const {
6220   return ptr;
6221 }
6222 
release()6223 __isl_give isl_ast_expr *ast_expr::release() {
6224   isl_ast_expr *tmp = ptr;
6225   ptr = nullptr;
6226   return tmp;
6227 }
6228 
is_null()6229 bool ast_expr::is_null() const {
6230   return ptr == nullptr;
6231 }
6232 
6233 template <typename T, typename>
isa_type(T subtype)6234 bool ast_expr::isa_type(T subtype) const
6235 {
6236   if (is_null())
6237     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6238   return isl_ast_expr_get_type(get()) == subtype;
6239 }
6240 template <class T>
isa()6241 bool ast_expr::isa() const
6242 {
6243   return isa_type<decltype(T::type)>(T::type);
6244 }
6245 template <class T>
as()6246 T ast_expr::as() const
6247 {
6248  if (!isa<T>())
6249     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6250   return T(copy());
6251 }
6252 
ctx()6253 isl::ctx ast_expr::ctx() const {
6254   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6255 }
6256 
to_C_str()6257 std::string ast_expr::to_C_str() const
6258 {
6259   if (!ptr)
6260     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6261   auto saved_ctx = ctx();
6262   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6263   auto res = isl_ast_expr_to_C_str(get());
6264   std::string tmp(res);
6265   free(res);
6266   return tmp;
6267 }
6268 
6269 inline std::ostream &operator<<(std::ostream &os, const ast_expr &obj)
6270 {
6271   if (!obj.get())
6272     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6273   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6274   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6275   char *str = isl_ast_expr_to_str(obj.get());
6276   if (!str)
6277     exception::throw_last_error(saved_ctx);
6278   os << str;
6279   free(str);
6280   return os;
6281 }
6282 
6283 // implementations for isl::ast_expr_id
ast_expr_id()6284 ast_expr_id::ast_expr_id()
6285     : ast_expr() {}
6286 
ast_expr_id(const ast_expr_id & obj)6287 ast_expr_id::ast_expr_id(const ast_expr_id &obj)
6288     : ast_expr(obj)
6289 {
6290 }
6291 
ast_expr_id(__isl_take isl_ast_expr * ptr)6292 ast_expr_id::ast_expr_id(__isl_take isl_ast_expr *ptr)
6293     : ast_expr(ptr) {}
6294 
6295 ast_expr_id &ast_expr_id::operator=(ast_expr_id obj) {
6296   std::swap(this->ptr, obj.ptr);
6297   return *this;
6298 }
6299 
ctx()6300 isl::ctx ast_expr_id::ctx() const {
6301   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6302 }
6303 
id()6304 isl::id ast_expr_id::id() const
6305 {
6306   if (!ptr)
6307     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6308   auto saved_ctx = ctx();
6309   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6310   auto res = isl_ast_expr_id_get_id(get());
6311   if (!res)
6312     exception::throw_last_error(saved_ctx);
6313   return manage(res);
6314 }
6315 
get_id()6316 isl::id ast_expr_id::get_id() const
6317 {
6318   return id();
6319 }
6320 
6321 inline std::ostream &operator<<(std::ostream &os, const ast_expr_id &obj)
6322 {
6323   if (!obj.get())
6324     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6325   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6326   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6327   char *str = isl_ast_expr_to_str(obj.get());
6328   if (!str)
6329     exception::throw_last_error(saved_ctx);
6330   os << str;
6331   free(str);
6332   return os;
6333 }
6334 
6335 // implementations for isl::ast_expr_int
ast_expr_int()6336 ast_expr_int::ast_expr_int()
6337     : ast_expr() {}
6338 
ast_expr_int(const ast_expr_int & obj)6339 ast_expr_int::ast_expr_int(const ast_expr_int &obj)
6340     : ast_expr(obj)
6341 {
6342 }
6343 
ast_expr_int(__isl_take isl_ast_expr * ptr)6344 ast_expr_int::ast_expr_int(__isl_take isl_ast_expr *ptr)
6345     : ast_expr(ptr) {}
6346 
6347 ast_expr_int &ast_expr_int::operator=(ast_expr_int obj) {
6348   std::swap(this->ptr, obj.ptr);
6349   return *this;
6350 }
6351 
ctx()6352 isl::ctx ast_expr_int::ctx() const {
6353   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6354 }
6355 
val()6356 isl::val ast_expr_int::val() const
6357 {
6358   if (!ptr)
6359     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6360   auto saved_ctx = ctx();
6361   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6362   auto res = isl_ast_expr_int_get_val(get());
6363   if (!res)
6364     exception::throw_last_error(saved_ctx);
6365   return manage(res);
6366 }
6367 
get_val()6368 isl::val ast_expr_int::get_val() const
6369 {
6370   return val();
6371 }
6372 
6373 inline std::ostream &operator<<(std::ostream &os, const ast_expr_int &obj)
6374 {
6375   if (!obj.get())
6376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6377   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6378   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6379   char *str = isl_ast_expr_to_str(obj.get());
6380   if (!str)
6381     exception::throw_last_error(saved_ctx);
6382   os << str;
6383   free(str);
6384   return os;
6385 }
6386 
6387 // implementations for isl::ast_expr_op
ast_expr_op()6388 ast_expr_op::ast_expr_op()
6389     : ast_expr() {}
6390 
ast_expr_op(const ast_expr_op & obj)6391 ast_expr_op::ast_expr_op(const ast_expr_op &obj)
6392     : ast_expr(obj)
6393 {
6394 }
6395 
ast_expr_op(__isl_take isl_ast_expr * ptr)6396 ast_expr_op::ast_expr_op(__isl_take isl_ast_expr *ptr)
6397     : ast_expr(ptr) {}
6398 
6399 ast_expr_op &ast_expr_op::operator=(ast_expr_op obj) {
6400   std::swap(this->ptr, obj.ptr);
6401   return *this;
6402 }
6403 
6404 template <typename T, typename>
isa_type(T subtype)6405 bool ast_expr_op::isa_type(T subtype) const
6406 {
6407   if (is_null())
6408     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6409   return isl_ast_expr_op_get_type(get()) == subtype;
6410 }
6411 template <class T>
isa()6412 bool ast_expr_op::isa() const
6413 {
6414   return isa_type<decltype(T::type)>(T::type);
6415 }
6416 template <class T>
as()6417 T ast_expr_op::as() const
6418 {
6419  if (!isa<T>())
6420     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6421   return T(copy());
6422 }
6423 
ctx()6424 isl::ctx ast_expr_op::ctx() const {
6425   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6426 }
6427 
arg(int pos)6428 isl::ast_expr ast_expr_op::arg(int pos) const
6429 {
6430   if (!ptr)
6431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6432   auto saved_ctx = ctx();
6433   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6434   auto res = isl_ast_expr_op_get_arg(get(), pos);
6435   if (!res)
6436     exception::throw_last_error(saved_ctx);
6437   return manage(res);
6438 }
6439 
get_arg(int pos)6440 isl::ast_expr ast_expr_op::get_arg(int pos) const
6441 {
6442   return arg(pos);
6443 }
6444 
n_arg()6445 unsigned ast_expr_op::n_arg() const
6446 {
6447   if (!ptr)
6448     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6449   auto saved_ctx = ctx();
6450   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6451   auto res = isl_ast_expr_op_get_n_arg(get());
6452   if (res < 0)
6453     exception::throw_last_error(saved_ctx);
6454   return res;
6455 }
6456 
get_n_arg()6457 unsigned ast_expr_op::get_n_arg() const
6458 {
6459   return n_arg();
6460 }
6461 
6462 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op &obj)
6463 {
6464   if (!obj.get())
6465     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6466   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6467   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6468   char *str = isl_ast_expr_to_str(obj.get());
6469   if (!str)
6470     exception::throw_last_error(saved_ctx);
6471   os << str;
6472   free(str);
6473   return os;
6474 }
6475 
6476 // implementations for isl::ast_expr_op_access
ast_expr_op_access()6477 ast_expr_op_access::ast_expr_op_access()
6478     : ast_expr_op() {}
6479 
ast_expr_op_access(const ast_expr_op_access & obj)6480 ast_expr_op_access::ast_expr_op_access(const ast_expr_op_access &obj)
6481     : ast_expr_op(obj)
6482 {
6483 }
6484 
ast_expr_op_access(__isl_take isl_ast_expr * ptr)6485 ast_expr_op_access::ast_expr_op_access(__isl_take isl_ast_expr *ptr)
6486     : ast_expr_op(ptr) {}
6487 
6488 ast_expr_op_access &ast_expr_op_access::operator=(ast_expr_op_access obj) {
6489   std::swap(this->ptr, obj.ptr);
6490   return *this;
6491 }
6492 
ctx()6493 isl::ctx ast_expr_op_access::ctx() const {
6494   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6495 }
6496 
6497 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_access &obj)
6498 {
6499   if (!obj.get())
6500     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6501   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6502   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6503   char *str = isl_ast_expr_to_str(obj.get());
6504   if (!str)
6505     exception::throw_last_error(saved_ctx);
6506   os << str;
6507   free(str);
6508   return os;
6509 }
6510 
6511 // implementations for isl::ast_expr_op_add
ast_expr_op_add()6512 ast_expr_op_add::ast_expr_op_add()
6513     : ast_expr_op() {}
6514 
ast_expr_op_add(const ast_expr_op_add & obj)6515 ast_expr_op_add::ast_expr_op_add(const ast_expr_op_add &obj)
6516     : ast_expr_op(obj)
6517 {
6518 }
6519 
ast_expr_op_add(__isl_take isl_ast_expr * ptr)6520 ast_expr_op_add::ast_expr_op_add(__isl_take isl_ast_expr *ptr)
6521     : ast_expr_op(ptr) {}
6522 
6523 ast_expr_op_add &ast_expr_op_add::operator=(ast_expr_op_add obj) {
6524   std::swap(this->ptr, obj.ptr);
6525   return *this;
6526 }
6527 
ctx()6528 isl::ctx ast_expr_op_add::ctx() const {
6529   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6530 }
6531 
6532 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_add &obj)
6533 {
6534   if (!obj.get())
6535     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6536   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6537   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6538   char *str = isl_ast_expr_to_str(obj.get());
6539   if (!str)
6540     exception::throw_last_error(saved_ctx);
6541   os << str;
6542   free(str);
6543   return os;
6544 }
6545 
6546 // implementations for isl::ast_expr_op_address_of
ast_expr_op_address_of()6547 ast_expr_op_address_of::ast_expr_op_address_of()
6548     : ast_expr_op() {}
6549 
ast_expr_op_address_of(const ast_expr_op_address_of & obj)6550 ast_expr_op_address_of::ast_expr_op_address_of(const ast_expr_op_address_of &obj)
6551     : ast_expr_op(obj)
6552 {
6553 }
6554 
ast_expr_op_address_of(__isl_take isl_ast_expr * ptr)6555 ast_expr_op_address_of::ast_expr_op_address_of(__isl_take isl_ast_expr *ptr)
6556     : ast_expr_op(ptr) {}
6557 
6558 ast_expr_op_address_of &ast_expr_op_address_of::operator=(ast_expr_op_address_of obj) {
6559   std::swap(this->ptr, obj.ptr);
6560   return *this;
6561 }
6562 
ctx()6563 isl::ctx ast_expr_op_address_of::ctx() const {
6564   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6565 }
6566 
6567 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_address_of &obj)
6568 {
6569   if (!obj.get())
6570     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6571   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6572   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6573   char *str = isl_ast_expr_to_str(obj.get());
6574   if (!str)
6575     exception::throw_last_error(saved_ctx);
6576   os << str;
6577   free(str);
6578   return os;
6579 }
6580 
6581 // implementations for isl::ast_expr_op_and
ast_expr_op_and()6582 ast_expr_op_and::ast_expr_op_and()
6583     : ast_expr_op() {}
6584 
ast_expr_op_and(const ast_expr_op_and & obj)6585 ast_expr_op_and::ast_expr_op_and(const ast_expr_op_and &obj)
6586     : ast_expr_op(obj)
6587 {
6588 }
6589 
ast_expr_op_and(__isl_take isl_ast_expr * ptr)6590 ast_expr_op_and::ast_expr_op_and(__isl_take isl_ast_expr *ptr)
6591     : ast_expr_op(ptr) {}
6592 
6593 ast_expr_op_and &ast_expr_op_and::operator=(ast_expr_op_and obj) {
6594   std::swap(this->ptr, obj.ptr);
6595   return *this;
6596 }
6597 
ctx()6598 isl::ctx ast_expr_op_and::ctx() const {
6599   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6600 }
6601 
6602 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and &obj)
6603 {
6604   if (!obj.get())
6605     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6606   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6607   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6608   char *str = isl_ast_expr_to_str(obj.get());
6609   if (!str)
6610     exception::throw_last_error(saved_ctx);
6611   os << str;
6612   free(str);
6613   return os;
6614 }
6615 
6616 // implementations for isl::ast_expr_op_and_then
ast_expr_op_and_then()6617 ast_expr_op_and_then::ast_expr_op_and_then()
6618     : ast_expr_op() {}
6619 
ast_expr_op_and_then(const ast_expr_op_and_then & obj)6620 ast_expr_op_and_then::ast_expr_op_and_then(const ast_expr_op_and_then &obj)
6621     : ast_expr_op(obj)
6622 {
6623 }
6624 
ast_expr_op_and_then(__isl_take isl_ast_expr * ptr)6625 ast_expr_op_and_then::ast_expr_op_and_then(__isl_take isl_ast_expr *ptr)
6626     : ast_expr_op(ptr) {}
6627 
6628 ast_expr_op_and_then &ast_expr_op_and_then::operator=(ast_expr_op_and_then obj) {
6629   std::swap(this->ptr, obj.ptr);
6630   return *this;
6631 }
6632 
ctx()6633 isl::ctx ast_expr_op_and_then::ctx() const {
6634   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6635 }
6636 
6637 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and_then &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_op_call
ast_expr_op_call()6652 ast_expr_op_call::ast_expr_op_call()
6653     : ast_expr_op() {}
6654 
ast_expr_op_call(const ast_expr_op_call & obj)6655 ast_expr_op_call::ast_expr_op_call(const ast_expr_op_call &obj)
6656     : ast_expr_op(obj)
6657 {
6658 }
6659 
ast_expr_op_call(__isl_take isl_ast_expr * ptr)6660 ast_expr_op_call::ast_expr_op_call(__isl_take isl_ast_expr *ptr)
6661     : ast_expr_op(ptr) {}
6662 
6663 ast_expr_op_call &ast_expr_op_call::operator=(ast_expr_op_call obj) {
6664   std::swap(this->ptr, obj.ptr);
6665   return *this;
6666 }
6667 
ctx()6668 isl::ctx ast_expr_op_call::ctx() const {
6669   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6670 }
6671 
6672 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_call &obj)
6673 {
6674   if (!obj.get())
6675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6676   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6677   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6678   char *str = isl_ast_expr_to_str(obj.get());
6679   if (!str)
6680     exception::throw_last_error(saved_ctx);
6681   os << str;
6682   free(str);
6683   return os;
6684 }
6685 
6686 // implementations for isl::ast_expr_op_cond
ast_expr_op_cond()6687 ast_expr_op_cond::ast_expr_op_cond()
6688     : ast_expr_op() {}
6689 
ast_expr_op_cond(const ast_expr_op_cond & obj)6690 ast_expr_op_cond::ast_expr_op_cond(const ast_expr_op_cond &obj)
6691     : ast_expr_op(obj)
6692 {
6693 }
6694 
ast_expr_op_cond(__isl_take isl_ast_expr * ptr)6695 ast_expr_op_cond::ast_expr_op_cond(__isl_take isl_ast_expr *ptr)
6696     : ast_expr_op(ptr) {}
6697 
6698 ast_expr_op_cond &ast_expr_op_cond::operator=(ast_expr_op_cond obj) {
6699   std::swap(this->ptr, obj.ptr);
6700   return *this;
6701 }
6702 
ctx()6703 isl::ctx ast_expr_op_cond::ctx() const {
6704   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6705 }
6706 
6707 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_cond &obj)
6708 {
6709   if (!obj.get())
6710     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6711   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6712   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6713   char *str = isl_ast_expr_to_str(obj.get());
6714   if (!str)
6715     exception::throw_last_error(saved_ctx);
6716   os << str;
6717   free(str);
6718   return os;
6719 }
6720 
6721 // implementations for isl::ast_expr_op_div
ast_expr_op_div()6722 ast_expr_op_div::ast_expr_op_div()
6723     : ast_expr_op() {}
6724 
ast_expr_op_div(const ast_expr_op_div & obj)6725 ast_expr_op_div::ast_expr_op_div(const ast_expr_op_div &obj)
6726     : ast_expr_op(obj)
6727 {
6728 }
6729 
ast_expr_op_div(__isl_take isl_ast_expr * ptr)6730 ast_expr_op_div::ast_expr_op_div(__isl_take isl_ast_expr *ptr)
6731     : ast_expr_op(ptr) {}
6732 
6733 ast_expr_op_div &ast_expr_op_div::operator=(ast_expr_op_div obj) {
6734   std::swap(this->ptr, obj.ptr);
6735   return *this;
6736 }
6737 
ctx()6738 isl::ctx ast_expr_op_div::ctx() const {
6739   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6740 }
6741 
6742 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_div &obj)
6743 {
6744   if (!obj.get())
6745     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6746   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6747   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6748   char *str = isl_ast_expr_to_str(obj.get());
6749   if (!str)
6750     exception::throw_last_error(saved_ctx);
6751   os << str;
6752   free(str);
6753   return os;
6754 }
6755 
6756 // implementations for isl::ast_expr_op_eq
ast_expr_op_eq()6757 ast_expr_op_eq::ast_expr_op_eq()
6758     : ast_expr_op() {}
6759 
ast_expr_op_eq(const ast_expr_op_eq & obj)6760 ast_expr_op_eq::ast_expr_op_eq(const ast_expr_op_eq &obj)
6761     : ast_expr_op(obj)
6762 {
6763 }
6764 
ast_expr_op_eq(__isl_take isl_ast_expr * ptr)6765 ast_expr_op_eq::ast_expr_op_eq(__isl_take isl_ast_expr *ptr)
6766     : ast_expr_op(ptr) {}
6767 
6768 ast_expr_op_eq &ast_expr_op_eq::operator=(ast_expr_op_eq obj) {
6769   std::swap(this->ptr, obj.ptr);
6770   return *this;
6771 }
6772 
ctx()6773 isl::ctx ast_expr_op_eq::ctx() const {
6774   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6775 }
6776 
6777 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_eq &obj)
6778 {
6779   if (!obj.get())
6780     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6781   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6782   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6783   char *str = isl_ast_expr_to_str(obj.get());
6784   if (!str)
6785     exception::throw_last_error(saved_ctx);
6786   os << str;
6787   free(str);
6788   return os;
6789 }
6790 
6791 // implementations for isl::ast_expr_op_fdiv_q
ast_expr_op_fdiv_q()6792 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q()
6793     : ast_expr_op() {}
6794 
ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q & obj)6795 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj)
6796     : ast_expr_op(obj)
6797 {
6798 }
6799 
ast_expr_op_fdiv_q(__isl_take isl_ast_expr * ptr)6800 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr)
6801     : ast_expr_op(ptr) {}
6802 
6803 ast_expr_op_fdiv_q &ast_expr_op_fdiv_q::operator=(ast_expr_op_fdiv_q obj) {
6804   std::swap(this->ptr, obj.ptr);
6805   return *this;
6806 }
6807 
ctx()6808 isl::ctx ast_expr_op_fdiv_q::ctx() const {
6809   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6810 }
6811 
6812 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_fdiv_q &obj)
6813 {
6814   if (!obj.get())
6815     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6816   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6817   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6818   char *str = isl_ast_expr_to_str(obj.get());
6819   if (!str)
6820     exception::throw_last_error(saved_ctx);
6821   os << str;
6822   free(str);
6823   return os;
6824 }
6825 
6826 // implementations for isl::ast_expr_op_ge
ast_expr_op_ge()6827 ast_expr_op_ge::ast_expr_op_ge()
6828     : ast_expr_op() {}
6829 
ast_expr_op_ge(const ast_expr_op_ge & obj)6830 ast_expr_op_ge::ast_expr_op_ge(const ast_expr_op_ge &obj)
6831     : ast_expr_op(obj)
6832 {
6833 }
6834 
ast_expr_op_ge(__isl_take isl_ast_expr * ptr)6835 ast_expr_op_ge::ast_expr_op_ge(__isl_take isl_ast_expr *ptr)
6836     : ast_expr_op(ptr) {}
6837 
6838 ast_expr_op_ge &ast_expr_op_ge::operator=(ast_expr_op_ge obj) {
6839   std::swap(this->ptr, obj.ptr);
6840   return *this;
6841 }
6842 
ctx()6843 isl::ctx ast_expr_op_ge::ctx() const {
6844   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6845 }
6846 
6847 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_ge &obj)
6848 {
6849   if (!obj.get())
6850     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6851   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6852   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6853   char *str = isl_ast_expr_to_str(obj.get());
6854   if (!str)
6855     exception::throw_last_error(saved_ctx);
6856   os << str;
6857   free(str);
6858   return os;
6859 }
6860 
6861 // implementations for isl::ast_expr_op_gt
ast_expr_op_gt()6862 ast_expr_op_gt::ast_expr_op_gt()
6863     : ast_expr_op() {}
6864 
ast_expr_op_gt(const ast_expr_op_gt & obj)6865 ast_expr_op_gt::ast_expr_op_gt(const ast_expr_op_gt &obj)
6866     : ast_expr_op(obj)
6867 {
6868 }
6869 
ast_expr_op_gt(__isl_take isl_ast_expr * ptr)6870 ast_expr_op_gt::ast_expr_op_gt(__isl_take isl_ast_expr *ptr)
6871     : ast_expr_op(ptr) {}
6872 
6873 ast_expr_op_gt &ast_expr_op_gt::operator=(ast_expr_op_gt obj) {
6874   std::swap(this->ptr, obj.ptr);
6875   return *this;
6876 }
6877 
ctx()6878 isl::ctx ast_expr_op_gt::ctx() const {
6879   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6880 }
6881 
6882 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_gt &obj)
6883 {
6884   if (!obj.get())
6885     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6886   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6887   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6888   char *str = isl_ast_expr_to_str(obj.get());
6889   if (!str)
6890     exception::throw_last_error(saved_ctx);
6891   os << str;
6892   free(str);
6893   return os;
6894 }
6895 
6896 // implementations for isl::ast_expr_op_le
ast_expr_op_le()6897 ast_expr_op_le::ast_expr_op_le()
6898     : ast_expr_op() {}
6899 
ast_expr_op_le(const ast_expr_op_le & obj)6900 ast_expr_op_le::ast_expr_op_le(const ast_expr_op_le &obj)
6901     : ast_expr_op(obj)
6902 {
6903 }
6904 
ast_expr_op_le(__isl_take isl_ast_expr * ptr)6905 ast_expr_op_le::ast_expr_op_le(__isl_take isl_ast_expr *ptr)
6906     : ast_expr_op(ptr) {}
6907 
6908 ast_expr_op_le &ast_expr_op_le::operator=(ast_expr_op_le obj) {
6909   std::swap(this->ptr, obj.ptr);
6910   return *this;
6911 }
6912 
ctx()6913 isl::ctx ast_expr_op_le::ctx() const {
6914   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6915 }
6916 
6917 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_le &obj)
6918 {
6919   if (!obj.get())
6920     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6921   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6922   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6923   char *str = isl_ast_expr_to_str(obj.get());
6924   if (!str)
6925     exception::throw_last_error(saved_ctx);
6926   os << str;
6927   free(str);
6928   return os;
6929 }
6930 
6931 // implementations for isl::ast_expr_op_lt
ast_expr_op_lt()6932 ast_expr_op_lt::ast_expr_op_lt()
6933     : ast_expr_op() {}
6934 
ast_expr_op_lt(const ast_expr_op_lt & obj)6935 ast_expr_op_lt::ast_expr_op_lt(const ast_expr_op_lt &obj)
6936     : ast_expr_op(obj)
6937 {
6938 }
6939 
ast_expr_op_lt(__isl_take isl_ast_expr * ptr)6940 ast_expr_op_lt::ast_expr_op_lt(__isl_take isl_ast_expr *ptr)
6941     : ast_expr_op(ptr) {}
6942 
6943 ast_expr_op_lt &ast_expr_op_lt::operator=(ast_expr_op_lt obj) {
6944   std::swap(this->ptr, obj.ptr);
6945   return *this;
6946 }
6947 
ctx()6948 isl::ctx ast_expr_op_lt::ctx() const {
6949   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6950 }
6951 
6952 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_lt &obj)
6953 {
6954   if (!obj.get())
6955     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6956   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6957   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6958   char *str = isl_ast_expr_to_str(obj.get());
6959   if (!str)
6960     exception::throw_last_error(saved_ctx);
6961   os << str;
6962   free(str);
6963   return os;
6964 }
6965 
6966 // implementations for isl::ast_expr_op_max
ast_expr_op_max()6967 ast_expr_op_max::ast_expr_op_max()
6968     : ast_expr_op() {}
6969 
ast_expr_op_max(const ast_expr_op_max & obj)6970 ast_expr_op_max::ast_expr_op_max(const ast_expr_op_max &obj)
6971     : ast_expr_op(obj)
6972 {
6973 }
6974 
ast_expr_op_max(__isl_take isl_ast_expr * ptr)6975 ast_expr_op_max::ast_expr_op_max(__isl_take isl_ast_expr *ptr)
6976     : ast_expr_op(ptr) {}
6977 
6978 ast_expr_op_max &ast_expr_op_max::operator=(ast_expr_op_max obj) {
6979   std::swap(this->ptr, obj.ptr);
6980   return *this;
6981 }
6982 
ctx()6983 isl::ctx ast_expr_op_max::ctx() const {
6984   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6985 }
6986 
6987 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_max &obj)
6988 {
6989   if (!obj.get())
6990     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6991   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6992   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6993   char *str = isl_ast_expr_to_str(obj.get());
6994   if (!str)
6995     exception::throw_last_error(saved_ctx);
6996   os << str;
6997   free(str);
6998   return os;
6999 }
7000 
7001 // implementations for isl::ast_expr_op_member
ast_expr_op_member()7002 ast_expr_op_member::ast_expr_op_member()
7003     : ast_expr_op() {}
7004 
ast_expr_op_member(const ast_expr_op_member & obj)7005 ast_expr_op_member::ast_expr_op_member(const ast_expr_op_member &obj)
7006     : ast_expr_op(obj)
7007 {
7008 }
7009 
ast_expr_op_member(__isl_take isl_ast_expr * ptr)7010 ast_expr_op_member::ast_expr_op_member(__isl_take isl_ast_expr *ptr)
7011     : ast_expr_op(ptr) {}
7012 
7013 ast_expr_op_member &ast_expr_op_member::operator=(ast_expr_op_member obj) {
7014   std::swap(this->ptr, obj.ptr);
7015   return *this;
7016 }
7017 
ctx()7018 isl::ctx ast_expr_op_member::ctx() const {
7019   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7020 }
7021 
7022 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_member &obj)
7023 {
7024   if (!obj.get())
7025     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7026   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7027   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7028   char *str = isl_ast_expr_to_str(obj.get());
7029   if (!str)
7030     exception::throw_last_error(saved_ctx);
7031   os << str;
7032   free(str);
7033   return os;
7034 }
7035 
7036 // implementations for isl::ast_expr_op_min
ast_expr_op_min()7037 ast_expr_op_min::ast_expr_op_min()
7038     : ast_expr_op() {}
7039 
ast_expr_op_min(const ast_expr_op_min & obj)7040 ast_expr_op_min::ast_expr_op_min(const ast_expr_op_min &obj)
7041     : ast_expr_op(obj)
7042 {
7043 }
7044 
ast_expr_op_min(__isl_take isl_ast_expr * ptr)7045 ast_expr_op_min::ast_expr_op_min(__isl_take isl_ast_expr *ptr)
7046     : ast_expr_op(ptr) {}
7047 
7048 ast_expr_op_min &ast_expr_op_min::operator=(ast_expr_op_min obj) {
7049   std::swap(this->ptr, obj.ptr);
7050   return *this;
7051 }
7052 
ctx()7053 isl::ctx ast_expr_op_min::ctx() const {
7054   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7055 }
7056 
7057 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_min &obj)
7058 {
7059   if (!obj.get())
7060     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7061   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7062   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7063   char *str = isl_ast_expr_to_str(obj.get());
7064   if (!str)
7065     exception::throw_last_error(saved_ctx);
7066   os << str;
7067   free(str);
7068   return os;
7069 }
7070 
7071 // implementations for isl::ast_expr_op_minus
ast_expr_op_minus()7072 ast_expr_op_minus::ast_expr_op_minus()
7073     : ast_expr_op() {}
7074 
ast_expr_op_minus(const ast_expr_op_minus & obj)7075 ast_expr_op_minus::ast_expr_op_minus(const ast_expr_op_minus &obj)
7076     : ast_expr_op(obj)
7077 {
7078 }
7079 
ast_expr_op_minus(__isl_take isl_ast_expr * ptr)7080 ast_expr_op_minus::ast_expr_op_minus(__isl_take isl_ast_expr *ptr)
7081     : ast_expr_op(ptr) {}
7082 
7083 ast_expr_op_minus &ast_expr_op_minus::operator=(ast_expr_op_minus obj) {
7084   std::swap(this->ptr, obj.ptr);
7085   return *this;
7086 }
7087 
ctx()7088 isl::ctx ast_expr_op_minus::ctx() const {
7089   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7090 }
7091 
7092 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_minus &obj)
7093 {
7094   if (!obj.get())
7095     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7096   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7097   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7098   char *str = isl_ast_expr_to_str(obj.get());
7099   if (!str)
7100     exception::throw_last_error(saved_ctx);
7101   os << str;
7102   free(str);
7103   return os;
7104 }
7105 
7106 // implementations for isl::ast_expr_op_mul
ast_expr_op_mul()7107 ast_expr_op_mul::ast_expr_op_mul()
7108     : ast_expr_op() {}
7109 
ast_expr_op_mul(const ast_expr_op_mul & obj)7110 ast_expr_op_mul::ast_expr_op_mul(const ast_expr_op_mul &obj)
7111     : ast_expr_op(obj)
7112 {
7113 }
7114 
ast_expr_op_mul(__isl_take isl_ast_expr * ptr)7115 ast_expr_op_mul::ast_expr_op_mul(__isl_take isl_ast_expr *ptr)
7116     : ast_expr_op(ptr) {}
7117 
7118 ast_expr_op_mul &ast_expr_op_mul::operator=(ast_expr_op_mul obj) {
7119   std::swap(this->ptr, obj.ptr);
7120   return *this;
7121 }
7122 
ctx()7123 isl::ctx ast_expr_op_mul::ctx() const {
7124   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7125 }
7126 
7127 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_mul &obj)
7128 {
7129   if (!obj.get())
7130     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7131   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7132   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7133   char *str = isl_ast_expr_to_str(obj.get());
7134   if (!str)
7135     exception::throw_last_error(saved_ctx);
7136   os << str;
7137   free(str);
7138   return os;
7139 }
7140 
7141 // implementations for isl::ast_expr_op_or
ast_expr_op_or()7142 ast_expr_op_or::ast_expr_op_or()
7143     : ast_expr_op() {}
7144 
ast_expr_op_or(const ast_expr_op_or & obj)7145 ast_expr_op_or::ast_expr_op_or(const ast_expr_op_or &obj)
7146     : ast_expr_op(obj)
7147 {
7148 }
7149 
ast_expr_op_or(__isl_take isl_ast_expr * ptr)7150 ast_expr_op_or::ast_expr_op_or(__isl_take isl_ast_expr *ptr)
7151     : ast_expr_op(ptr) {}
7152 
7153 ast_expr_op_or &ast_expr_op_or::operator=(ast_expr_op_or obj) {
7154   std::swap(this->ptr, obj.ptr);
7155   return *this;
7156 }
7157 
ctx()7158 isl::ctx ast_expr_op_or::ctx() const {
7159   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7160 }
7161 
7162 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or &obj)
7163 {
7164   if (!obj.get())
7165     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7166   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7167   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7168   char *str = isl_ast_expr_to_str(obj.get());
7169   if (!str)
7170     exception::throw_last_error(saved_ctx);
7171   os << str;
7172   free(str);
7173   return os;
7174 }
7175 
7176 // implementations for isl::ast_expr_op_or_else
ast_expr_op_or_else()7177 ast_expr_op_or_else::ast_expr_op_or_else()
7178     : ast_expr_op() {}
7179 
ast_expr_op_or_else(const ast_expr_op_or_else & obj)7180 ast_expr_op_or_else::ast_expr_op_or_else(const ast_expr_op_or_else &obj)
7181     : ast_expr_op(obj)
7182 {
7183 }
7184 
ast_expr_op_or_else(__isl_take isl_ast_expr * ptr)7185 ast_expr_op_or_else::ast_expr_op_or_else(__isl_take isl_ast_expr *ptr)
7186     : ast_expr_op(ptr) {}
7187 
7188 ast_expr_op_or_else &ast_expr_op_or_else::operator=(ast_expr_op_or_else obj) {
7189   std::swap(this->ptr, obj.ptr);
7190   return *this;
7191 }
7192 
ctx()7193 isl::ctx ast_expr_op_or_else::ctx() const {
7194   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7195 }
7196 
7197 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or_else &obj)
7198 {
7199   if (!obj.get())
7200     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7201   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7202   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7203   char *str = isl_ast_expr_to_str(obj.get());
7204   if (!str)
7205     exception::throw_last_error(saved_ctx);
7206   os << str;
7207   free(str);
7208   return os;
7209 }
7210 
7211 // implementations for isl::ast_expr_op_pdiv_q
ast_expr_op_pdiv_q()7212 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q()
7213     : ast_expr_op() {}
7214 
ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q & obj)7215 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj)
7216     : ast_expr_op(obj)
7217 {
7218 }
7219 
ast_expr_op_pdiv_q(__isl_take isl_ast_expr * ptr)7220 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr)
7221     : ast_expr_op(ptr) {}
7222 
7223 ast_expr_op_pdiv_q &ast_expr_op_pdiv_q::operator=(ast_expr_op_pdiv_q obj) {
7224   std::swap(this->ptr, obj.ptr);
7225   return *this;
7226 }
7227 
ctx()7228 isl::ctx ast_expr_op_pdiv_q::ctx() const {
7229   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7230 }
7231 
7232 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_q &obj)
7233 {
7234   if (!obj.get())
7235     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7236   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7237   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7238   char *str = isl_ast_expr_to_str(obj.get());
7239   if (!str)
7240     exception::throw_last_error(saved_ctx);
7241   os << str;
7242   free(str);
7243   return os;
7244 }
7245 
7246 // implementations for isl::ast_expr_op_pdiv_r
ast_expr_op_pdiv_r()7247 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r()
7248     : ast_expr_op() {}
7249 
ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r & obj)7250 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj)
7251     : ast_expr_op(obj)
7252 {
7253 }
7254 
ast_expr_op_pdiv_r(__isl_take isl_ast_expr * ptr)7255 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr)
7256     : ast_expr_op(ptr) {}
7257 
7258 ast_expr_op_pdiv_r &ast_expr_op_pdiv_r::operator=(ast_expr_op_pdiv_r obj) {
7259   std::swap(this->ptr, obj.ptr);
7260   return *this;
7261 }
7262 
ctx()7263 isl::ctx ast_expr_op_pdiv_r::ctx() const {
7264   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7265 }
7266 
7267 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_r &obj)
7268 {
7269   if (!obj.get())
7270     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7271   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7272   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7273   char *str = isl_ast_expr_to_str(obj.get());
7274   if (!str)
7275     exception::throw_last_error(saved_ctx);
7276   os << str;
7277   free(str);
7278   return os;
7279 }
7280 
7281 // implementations for isl::ast_expr_op_select
ast_expr_op_select()7282 ast_expr_op_select::ast_expr_op_select()
7283     : ast_expr_op() {}
7284 
ast_expr_op_select(const ast_expr_op_select & obj)7285 ast_expr_op_select::ast_expr_op_select(const ast_expr_op_select &obj)
7286     : ast_expr_op(obj)
7287 {
7288 }
7289 
ast_expr_op_select(__isl_take isl_ast_expr * ptr)7290 ast_expr_op_select::ast_expr_op_select(__isl_take isl_ast_expr *ptr)
7291     : ast_expr_op(ptr) {}
7292 
7293 ast_expr_op_select &ast_expr_op_select::operator=(ast_expr_op_select obj) {
7294   std::swap(this->ptr, obj.ptr);
7295   return *this;
7296 }
7297 
ctx()7298 isl::ctx ast_expr_op_select::ctx() const {
7299   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7300 }
7301 
7302 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_select &obj)
7303 {
7304   if (!obj.get())
7305     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7306   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7307   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7308   char *str = isl_ast_expr_to_str(obj.get());
7309   if (!str)
7310     exception::throw_last_error(saved_ctx);
7311   os << str;
7312   free(str);
7313   return os;
7314 }
7315 
7316 // implementations for isl::ast_expr_op_sub
ast_expr_op_sub()7317 ast_expr_op_sub::ast_expr_op_sub()
7318     : ast_expr_op() {}
7319 
ast_expr_op_sub(const ast_expr_op_sub & obj)7320 ast_expr_op_sub::ast_expr_op_sub(const ast_expr_op_sub &obj)
7321     : ast_expr_op(obj)
7322 {
7323 }
7324 
ast_expr_op_sub(__isl_take isl_ast_expr * ptr)7325 ast_expr_op_sub::ast_expr_op_sub(__isl_take isl_ast_expr *ptr)
7326     : ast_expr_op(ptr) {}
7327 
7328 ast_expr_op_sub &ast_expr_op_sub::operator=(ast_expr_op_sub obj) {
7329   std::swap(this->ptr, obj.ptr);
7330   return *this;
7331 }
7332 
ctx()7333 isl::ctx ast_expr_op_sub::ctx() const {
7334   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7335 }
7336 
7337 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_sub &obj)
7338 {
7339   if (!obj.get())
7340     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7341   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7342   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7343   char *str = isl_ast_expr_to_str(obj.get());
7344   if (!str)
7345     exception::throw_last_error(saved_ctx);
7346   os << str;
7347   free(str);
7348   return os;
7349 }
7350 
7351 // implementations for isl::ast_expr_op_zdiv_r
ast_expr_op_zdiv_r()7352 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r()
7353     : ast_expr_op() {}
7354 
ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r & obj)7355 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj)
7356     : ast_expr_op(obj)
7357 {
7358 }
7359 
ast_expr_op_zdiv_r(__isl_take isl_ast_expr * ptr)7360 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr)
7361     : ast_expr_op(ptr) {}
7362 
7363 ast_expr_op_zdiv_r &ast_expr_op_zdiv_r::operator=(ast_expr_op_zdiv_r obj) {
7364   std::swap(this->ptr, obj.ptr);
7365   return *this;
7366 }
7367 
ctx()7368 isl::ctx ast_expr_op_zdiv_r::ctx() const {
7369   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7370 }
7371 
7372 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_zdiv_r &obj)
7373 {
7374   if (!obj.get())
7375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7376   auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7377   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7378   char *str = isl_ast_expr_to_str(obj.get());
7379   if (!str)
7380     exception::throw_last_error(saved_ctx);
7381   os << str;
7382   free(str);
7383   return os;
7384 }
7385 
7386 // implementations for isl::ast_node
manage(__isl_take isl_ast_node * ptr)7387 ast_node manage(__isl_take isl_ast_node *ptr) {
7388   if (!ptr)
7389     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7390   return ast_node(ptr);
7391 }
manage_copy(__isl_keep isl_ast_node * ptr)7392 ast_node manage_copy(__isl_keep isl_ast_node *ptr) {
7393   if (!ptr)
7394     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7395   auto saved_ctx = isl_ast_node_get_ctx(ptr);
7396   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7397   ptr = isl_ast_node_copy(ptr);
7398   if (!ptr)
7399     exception::throw_last_error(saved_ctx);
7400   return ast_node(ptr);
7401 }
7402 
ast_node()7403 ast_node::ast_node()
7404     : ptr(nullptr) {}
7405 
ast_node(const ast_node & obj)7406 ast_node::ast_node(const ast_node &obj)
7407     : ptr(nullptr)
7408 {
7409   if (!obj.ptr)
7410     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7411   auto saved_ctx = isl_ast_node_get_ctx(obj.ptr);
7412   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7413   ptr = obj.copy();
7414   if (!ptr)
7415     exception::throw_last_error(saved_ctx);
7416 }
7417 
ast_node(__isl_take isl_ast_node * ptr)7418 ast_node::ast_node(__isl_take isl_ast_node *ptr)
7419     : ptr(ptr) {}
7420 
7421 ast_node &ast_node::operator=(ast_node obj) {
7422   std::swap(this->ptr, obj.ptr);
7423   return *this;
7424 }
7425 
~ast_node()7426 ast_node::~ast_node() {
7427   if (ptr)
7428     isl_ast_node_free(ptr);
7429 }
7430 
copy()7431 __isl_give isl_ast_node *ast_node::copy() const & {
7432   return isl_ast_node_copy(ptr);
7433 }
7434 
get()7435 __isl_keep isl_ast_node *ast_node::get() const {
7436   return ptr;
7437 }
7438 
release()7439 __isl_give isl_ast_node *ast_node::release() {
7440   isl_ast_node *tmp = ptr;
7441   ptr = nullptr;
7442   return tmp;
7443 }
7444 
is_null()7445 bool ast_node::is_null() const {
7446   return ptr == nullptr;
7447 }
7448 
7449 template <typename T, typename>
isa_type(T subtype)7450 bool ast_node::isa_type(T subtype) const
7451 {
7452   if (is_null())
7453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7454   return isl_ast_node_get_type(get()) == subtype;
7455 }
7456 template <class T>
isa()7457 bool ast_node::isa() const
7458 {
7459   return isa_type<decltype(T::type)>(T::type);
7460 }
7461 template <class T>
as()7462 T ast_node::as() const
7463 {
7464  if (!isa<T>())
7465     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
7466   return T(copy());
7467 }
7468 
ctx()7469 isl::ctx ast_node::ctx() const {
7470   return isl::ctx(isl_ast_node_get_ctx(ptr));
7471 }
7472 
to_C_str()7473 std::string ast_node::to_C_str() const
7474 {
7475   if (!ptr)
7476     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7477   auto saved_ctx = ctx();
7478   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7479   auto res = isl_ast_node_to_C_str(get());
7480   std::string tmp(res);
7481   free(res);
7482   return tmp;
7483 }
7484 
to_list()7485 isl::ast_node_list ast_node::to_list() const
7486 {
7487   if (!ptr)
7488     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7489   auto saved_ctx = ctx();
7490   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7491   auto res = isl_ast_node_to_list(copy());
7492   if (!res)
7493     exception::throw_last_error(saved_ctx);
7494   return manage(res);
7495 }
7496 
7497 inline std::ostream &operator<<(std::ostream &os, const ast_node &obj)
7498 {
7499   if (!obj.get())
7500     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7501   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7502   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7503   char *str = isl_ast_node_to_str(obj.get());
7504   if (!str)
7505     exception::throw_last_error(saved_ctx);
7506   os << str;
7507   free(str);
7508   return os;
7509 }
7510 
7511 // implementations for isl::ast_node_block
ast_node_block()7512 ast_node_block::ast_node_block()
7513     : ast_node() {}
7514 
ast_node_block(const ast_node_block & obj)7515 ast_node_block::ast_node_block(const ast_node_block &obj)
7516     : ast_node(obj)
7517 {
7518 }
7519 
ast_node_block(__isl_take isl_ast_node * ptr)7520 ast_node_block::ast_node_block(__isl_take isl_ast_node *ptr)
7521     : ast_node(ptr) {}
7522 
7523 ast_node_block &ast_node_block::operator=(ast_node_block obj) {
7524   std::swap(this->ptr, obj.ptr);
7525   return *this;
7526 }
7527 
ctx()7528 isl::ctx ast_node_block::ctx() const {
7529   return isl::ctx(isl_ast_node_get_ctx(ptr));
7530 }
7531 
children()7532 isl::ast_node_list ast_node_block::children() const
7533 {
7534   if (!ptr)
7535     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7536   auto saved_ctx = ctx();
7537   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7538   auto res = isl_ast_node_block_get_children(get());
7539   if (!res)
7540     exception::throw_last_error(saved_ctx);
7541   return manage(res);
7542 }
7543 
get_children()7544 isl::ast_node_list ast_node_block::get_children() const
7545 {
7546   return children();
7547 }
7548 
7549 inline std::ostream &operator<<(std::ostream &os, const ast_node_block &obj)
7550 {
7551   if (!obj.get())
7552     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7553   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7554   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7555   char *str = isl_ast_node_to_str(obj.get());
7556   if (!str)
7557     exception::throw_last_error(saved_ctx);
7558   os << str;
7559   free(str);
7560   return os;
7561 }
7562 
7563 // implementations for isl::ast_node_for
ast_node_for()7564 ast_node_for::ast_node_for()
7565     : ast_node() {}
7566 
ast_node_for(const ast_node_for & obj)7567 ast_node_for::ast_node_for(const ast_node_for &obj)
7568     : ast_node(obj)
7569 {
7570 }
7571 
ast_node_for(__isl_take isl_ast_node * ptr)7572 ast_node_for::ast_node_for(__isl_take isl_ast_node *ptr)
7573     : ast_node(ptr) {}
7574 
7575 ast_node_for &ast_node_for::operator=(ast_node_for obj) {
7576   std::swap(this->ptr, obj.ptr);
7577   return *this;
7578 }
7579 
ctx()7580 isl::ctx ast_node_for::ctx() const {
7581   return isl::ctx(isl_ast_node_get_ctx(ptr));
7582 }
7583 
body()7584 isl::ast_node ast_node_for::body() const
7585 {
7586   if (!ptr)
7587     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7588   auto saved_ctx = ctx();
7589   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7590   auto res = isl_ast_node_for_get_body(get());
7591   if (!res)
7592     exception::throw_last_error(saved_ctx);
7593   return manage(res);
7594 }
7595 
get_body()7596 isl::ast_node ast_node_for::get_body() const
7597 {
7598   return body();
7599 }
7600 
cond()7601 isl::ast_expr ast_node_for::cond() const
7602 {
7603   if (!ptr)
7604     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7605   auto saved_ctx = ctx();
7606   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7607   auto res = isl_ast_node_for_get_cond(get());
7608   if (!res)
7609     exception::throw_last_error(saved_ctx);
7610   return manage(res);
7611 }
7612 
get_cond()7613 isl::ast_expr ast_node_for::get_cond() const
7614 {
7615   return cond();
7616 }
7617 
inc()7618 isl::ast_expr ast_node_for::inc() const
7619 {
7620   if (!ptr)
7621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7622   auto saved_ctx = ctx();
7623   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7624   auto res = isl_ast_node_for_get_inc(get());
7625   if (!res)
7626     exception::throw_last_error(saved_ctx);
7627   return manage(res);
7628 }
7629 
get_inc()7630 isl::ast_expr ast_node_for::get_inc() const
7631 {
7632   return inc();
7633 }
7634 
init()7635 isl::ast_expr ast_node_for::init() const
7636 {
7637   if (!ptr)
7638     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7639   auto saved_ctx = ctx();
7640   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7641   auto res = isl_ast_node_for_get_init(get());
7642   if (!res)
7643     exception::throw_last_error(saved_ctx);
7644   return manage(res);
7645 }
7646 
get_init()7647 isl::ast_expr ast_node_for::get_init() const
7648 {
7649   return init();
7650 }
7651 
is_degenerate()7652 bool ast_node_for::is_degenerate() const
7653 {
7654   if (!ptr)
7655     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7656   auto saved_ctx = ctx();
7657   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7658   auto res = isl_ast_node_for_is_degenerate(get());
7659   if (res < 0)
7660     exception::throw_last_error(saved_ctx);
7661   return res;
7662 }
7663 
iterator()7664 isl::ast_expr ast_node_for::iterator() const
7665 {
7666   if (!ptr)
7667     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7668   auto saved_ctx = ctx();
7669   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7670   auto res = isl_ast_node_for_get_iterator(get());
7671   if (!res)
7672     exception::throw_last_error(saved_ctx);
7673   return manage(res);
7674 }
7675 
get_iterator()7676 isl::ast_expr ast_node_for::get_iterator() const
7677 {
7678   return iterator();
7679 }
7680 
7681 inline std::ostream &operator<<(std::ostream &os, const ast_node_for &obj)
7682 {
7683   if (!obj.get())
7684     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7685   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7686   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7687   char *str = isl_ast_node_to_str(obj.get());
7688   if (!str)
7689     exception::throw_last_error(saved_ctx);
7690   os << str;
7691   free(str);
7692   return os;
7693 }
7694 
7695 // implementations for isl::ast_node_if
ast_node_if()7696 ast_node_if::ast_node_if()
7697     : ast_node() {}
7698 
ast_node_if(const ast_node_if & obj)7699 ast_node_if::ast_node_if(const ast_node_if &obj)
7700     : ast_node(obj)
7701 {
7702 }
7703 
ast_node_if(__isl_take isl_ast_node * ptr)7704 ast_node_if::ast_node_if(__isl_take isl_ast_node *ptr)
7705     : ast_node(ptr) {}
7706 
7707 ast_node_if &ast_node_if::operator=(ast_node_if obj) {
7708   std::swap(this->ptr, obj.ptr);
7709   return *this;
7710 }
7711 
ctx()7712 isl::ctx ast_node_if::ctx() const {
7713   return isl::ctx(isl_ast_node_get_ctx(ptr));
7714 }
7715 
cond()7716 isl::ast_expr ast_node_if::cond() const
7717 {
7718   if (!ptr)
7719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7720   auto saved_ctx = ctx();
7721   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7722   auto res = isl_ast_node_if_get_cond(get());
7723   if (!res)
7724     exception::throw_last_error(saved_ctx);
7725   return manage(res);
7726 }
7727 
get_cond()7728 isl::ast_expr ast_node_if::get_cond() const
7729 {
7730   return cond();
7731 }
7732 
else_node()7733 isl::ast_node ast_node_if::else_node() const
7734 {
7735   if (!ptr)
7736     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7737   auto saved_ctx = ctx();
7738   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7739   auto res = isl_ast_node_if_get_else_node(get());
7740   if (!res)
7741     exception::throw_last_error(saved_ctx);
7742   return manage(res);
7743 }
7744 
get_else_node()7745 isl::ast_node ast_node_if::get_else_node() const
7746 {
7747   return else_node();
7748 }
7749 
has_else_node()7750 bool ast_node_if::has_else_node() const
7751 {
7752   if (!ptr)
7753     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7754   auto saved_ctx = ctx();
7755   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7756   auto res = isl_ast_node_if_has_else_node(get());
7757   if (res < 0)
7758     exception::throw_last_error(saved_ctx);
7759   return res;
7760 }
7761 
then_node()7762 isl::ast_node ast_node_if::then_node() const
7763 {
7764   if (!ptr)
7765     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7766   auto saved_ctx = ctx();
7767   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7768   auto res = isl_ast_node_if_get_then_node(get());
7769   if (!res)
7770     exception::throw_last_error(saved_ctx);
7771   return manage(res);
7772 }
7773 
get_then_node()7774 isl::ast_node ast_node_if::get_then_node() const
7775 {
7776   return then_node();
7777 }
7778 
7779 inline std::ostream &operator<<(std::ostream &os, const ast_node_if &obj)
7780 {
7781   if (!obj.get())
7782     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7783   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7784   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7785   char *str = isl_ast_node_to_str(obj.get());
7786   if (!str)
7787     exception::throw_last_error(saved_ctx);
7788   os << str;
7789   free(str);
7790   return os;
7791 }
7792 
7793 // implementations for isl::ast_node_list
manage(__isl_take isl_ast_node_list * ptr)7794 ast_node_list manage(__isl_take isl_ast_node_list *ptr) {
7795   if (!ptr)
7796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7797   return ast_node_list(ptr);
7798 }
manage_copy(__isl_keep isl_ast_node_list * ptr)7799 ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr) {
7800   if (!ptr)
7801     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7802   auto saved_ctx = isl_ast_node_list_get_ctx(ptr);
7803   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7804   ptr = isl_ast_node_list_copy(ptr);
7805   if (!ptr)
7806     exception::throw_last_error(saved_ctx);
7807   return ast_node_list(ptr);
7808 }
7809 
ast_node_list()7810 ast_node_list::ast_node_list()
7811     : ptr(nullptr) {}
7812 
ast_node_list(const ast_node_list & obj)7813 ast_node_list::ast_node_list(const ast_node_list &obj)
7814     : ptr(nullptr)
7815 {
7816   if (!obj.ptr)
7817     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7818   auto saved_ctx = isl_ast_node_list_get_ctx(obj.ptr);
7819   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7820   ptr = obj.copy();
7821   if (!ptr)
7822     exception::throw_last_error(saved_ctx);
7823 }
7824 
ast_node_list(__isl_take isl_ast_node_list * ptr)7825 ast_node_list::ast_node_list(__isl_take isl_ast_node_list *ptr)
7826     : ptr(ptr) {}
7827 
ast_node_list(isl::ctx ctx,int n)7828 ast_node_list::ast_node_list(isl::ctx ctx, int n)
7829 {
7830   auto saved_ctx = ctx;
7831   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7832   auto res = isl_ast_node_list_alloc(ctx.release(), n);
7833   if (!res)
7834     exception::throw_last_error(saved_ctx);
7835   ptr = res;
7836 }
7837 
ast_node_list(isl::ast_node el)7838 ast_node_list::ast_node_list(isl::ast_node el)
7839 {
7840   if (el.is_null())
7841     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7842   auto saved_ctx = el.ctx();
7843   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7844   auto res = isl_ast_node_list_from_ast_node(el.release());
7845   if (!res)
7846     exception::throw_last_error(saved_ctx);
7847   ptr = res;
7848 }
7849 
7850 ast_node_list &ast_node_list::operator=(ast_node_list obj) {
7851   std::swap(this->ptr, obj.ptr);
7852   return *this;
7853 }
7854 
~ast_node_list()7855 ast_node_list::~ast_node_list() {
7856   if (ptr)
7857     isl_ast_node_list_free(ptr);
7858 }
7859 
copy()7860 __isl_give isl_ast_node_list *ast_node_list::copy() const & {
7861   return isl_ast_node_list_copy(ptr);
7862 }
7863 
get()7864 __isl_keep isl_ast_node_list *ast_node_list::get() const {
7865   return ptr;
7866 }
7867 
release()7868 __isl_give isl_ast_node_list *ast_node_list::release() {
7869   isl_ast_node_list *tmp = ptr;
7870   ptr = nullptr;
7871   return tmp;
7872 }
7873 
is_null()7874 bool ast_node_list::is_null() const {
7875   return ptr == nullptr;
7876 }
7877 
ctx()7878 isl::ctx ast_node_list::ctx() const {
7879   return isl::ctx(isl_ast_node_list_get_ctx(ptr));
7880 }
7881 
add(isl::ast_node el)7882 isl::ast_node_list ast_node_list::add(isl::ast_node el) const
7883 {
7884   if (!ptr || el.is_null())
7885     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7886   auto saved_ctx = ctx();
7887   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7888   auto res = isl_ast_node_list_add(copy(), el.release());
7889   if (!res)
7890     exception::throw_last_error(saved_ctx);
7891   return manage(res);
7892 }
7893 
at(int index)7894 isl::ast_node ast_node_list::at(int index) const
7895 {
7896   if (!ptr)
7897     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7898   auto saved_ctx = ctx();
7899   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7900   auto res = isl_ast_node_list_get_at(get(), index);
7901   if (!res)
7902     exception::throw_last_error(saved_ctx);
7903   return manage(res);
7904 }
7905 
get_at(int index)7906 isl::ast_node ast_node_list::get_at(int index) const
7907 {
7908   return at(index);
7909 }
7910 
clear()7911 isl::ast_node_list ast_node_list::clear() const
7912 {
7913   if (!ptr)
7914     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7915   auto saved_ctx = ctx();
7916   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7917   auto res = isl_ast_node_list_clear(copy());
7918   if (!res)
7919     exception::throw_last_error(saved_ctx);
7920   return manage(res);
7921 }
7922 
concat(isl::ast_node_list list2)7923 isl::ast_node_list ast_node_list::concat(isl::ast_node_list list2) const
7924 {
7925   if (!ptr || list2.is_null())
7926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7927   auto saved_ctx = ctx();
7928   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7929   auto res = isl_ast_node_list_concat(copy(), list2.release());
7930   if (!res)
7931     exception::throw_last_error(saved_ctx);
7932   return manage(res);
7933 }
7934 
drop(unsigned int first,unsigned int n)7935 isl::ast_node_list ast_node_list::drop(unsigned int first, unsigned int n) const
7936 {
7937   if (!ptr)
7938     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7939   auto saved_ctx = ctx();
7940   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7941   auto res = isl_ast_node_list_drop(copy(), first, n);
7942   if (!res)
7943     exception::throw_last_error(saved_ctx);
7944   return manage(res);
7945 }
7946 
foreach(const std::function<void (isl::ast_node)> & fn)7947 void ast_node_list::foreach(const std::function<void(isl::ast_node)> &fn) const
7948 {
7949   if (!ptr)
7950     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7951   auto saved_ctx = ctx();
7952   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7953   struct fn_data {
7954     std::function<void(isl::ast_node)> func;
7955     std::exception_ptr eptr;
7956   } fn_data = { fn };
7957   auto fn_lambda = [](isl_ast_node *arg_0, void *arg_1) -> isl_stat {
7958     auto *data = static_cast<struct fn_data *>(arg_1);
7959     ISL_CPP_TRY {
7960       (data->func)(manage(arg_0));
7961       return isl_stat_ok;
7962     } ISL_CPP_CATCH_ALL {
7963       data->eptr = std::current_exception();
7964       return isl_stat_error;
7965     }
7966   };
7967   auto res = isl_ast_node_list_foreach(get(), fn_lambda, &fn_data);
7968   if (fn_data.eptr)
7969     std::rethrow_exception(fn_data.eptr);
7970   if (res < 0)
7971     exception::throw_last_error(saved_ctx);
7972   return;
7973 }
7974 
insert(unsigned int pos,isl::ast_node el)7975 isl::ast_node_list ast_node_list::insert(unsigned int pos, isl::ast_node el) const
7976 {
7977   if (!ptr || el.is_null())
7978     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7979   auto saved_ctx = ctx();
7980   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7981   auto res = isl_ast_node_list_insert(copy(), pos, el.release());
7982   if (!res)
7983     exception::throw_last_error(saved_ctx);
7984   return manage(res);
7985 }
7986 
size()7987 unsigned ast_node_list::size() const
7988 {
7989   if (!ptr)
7990     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7991   auto saved_ctx = ctx();
7992   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7993   auto res = isl_ast_node_list_size(get());
7994   if (res < 0)
7995     exception::throw_last_error(saved_ctx);
7996   return res;
7997 }
7998 
7999 inline std::ostream &operator<<(std::ostream &os, const ast_node_list &obj)
8000 {
8001   if (!obj.get())
8002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8003   auto saved_ctx = isl_ast_node_list_get_ctx(obj.get());
8004   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8005   char *str = isl_ast_node_list_to_str(obj.get());
8006   if (!str)
8007     exception::throw_last_error(saved_ctx);
8008   os << str;
8009   free(str);
8010   return os;
8011 }
8012 
8013 // implementations for isl::ast_node_mark
ast_node_mark()8014 ast_node_mark::ast_node_mark()
8015     : ast_node() {}
8016 
ast_node_mark(const ast_node_mark & obj)8017 ast_node_mark::ast_node_mark(const ast_node_mark &obj)
8018     : ast_node(obj)
8019 {
8020 }
8021 
ast_node_mark(__isl_take isl_ast_node * ptr)8022 ast_node_mark::ast_node_mark(__isl_take isl_ast_node *ptr)
8023     : ast_node(ptr) {}
8024 
8025 ast_node_mark &ast_node_mark::operator=(ast_node_mark obj) {
8026   std::swap(this->ptr, obj.ptr);
8027   return *this;
8028 }
8029 
ctx()8030 isl::ctx ast_node_mark::ctx() const {
8031   return isl::ctx(isl_ast_node_get_ctx(ptr));
8032 }
8033 
id()8034 isl::id ast_node_mark::id() const
8035 {
8036   if (!ptr)
8037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8038   auto saved_ctx = ctx();
8039   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8040   auto res = isl_ast_node_mark_get_id(get());
8041   if (!res)
8042     exception::throw_last_error(saved_ctx);
8043   return manage(res);
8044 }
8045 
get_id()8046 isl::id ast_node_mark::get_id() const
8047 {
8048   return id();
8049 }
8050 
node()8051 isl::ast_node ast_node_mark::node() const
8052 {
8053   if (!ptr)
8054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8055   auto saved_ctx = ctx();
8056   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8057   auto res = isl_ast_node_mark_get_node(get());
8058   if (!res)
8059     exception::throw_last_error(saved_ctx);
8060   return manage(res);
8061 }
8062 
get_node()8063 isl::ast_node ast_node_mark::get_node() const
8064 {
8065   return node();
8066 }
8067 
8068 inline std::ostream &operator<<(std::ostream &os, const ast_node_mark &obj)
8069 {
8070   if (!obj.get())
8071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8072   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8073   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8074   char *str = isl_ast_node_to_str(obj.get());
8075   if (!str)
8076     exception::throw_last_error(saved_ctx);
8077   os << str;
8078   free(str);
8079   return os;
8080 }
8081 
8082 // implementations for isl::ast_node_user
ast_node_user()8083 ast_node_user::ast_node_user()
8084     : ast_node() {}
8085 
ast_node_user(const ast_node_user & obj)8086 ast_node_user::ast_node_user(const ast_node_user &obj)
8087     : ast_node(obj)
8088 {
8089 }
8090 
ast_node_user(__isl_take isl_ast_node * ptr)8091 ast_node_user::ast_node_user(__isl_take isl_ast_node *ptr)
8092     : ast_node(ptr) {}
8093 
8094 ast_node_user &ast_node_user::operator=(ast_node_user obj) {
8095   std::swap(this->ptr, obj.ptr);
8096   return *this;
8097 }
8098 
ctx()8099 isl::ctx ast_node_user::ctx() const {
8100   return isl::ctx(isl_ast_node_get_ctx(ptr));
8101 }
8102 
expr()8103 isl::ast_expr ast_node_user::expr() const
8104 {
8105   if (!ptr)
8106     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8107   auto saved_ctx = ctx();
8108   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8109   auto res = isl_ast_node_user_get_expr(get());
8110   if (!res)
8111     exception::throw_last_error(saved_ctx);
8112   return manage(res);
8113 }
8114 
get_expr()8115 isl::ast_expr ast_node_user::get_expr() const
8116 {
8117   return expr();
8118 }
8119 
8120 inline std::ostream &operator<<(std::ostream &os, const ast_node_user &obj)
8121 {
8122   if (!obj.get())
8123     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8124   auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8125   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8126   char *str = isl_ast_node_to_str(obj.get());
8127   if (!str)
8128     exception::throw_last_error(saved_ctx);
8129   os << str;
8130   free(str);
8131   return os;
8132 }
8133 
8134 // implementations for isl::basic_map
manage(__isl_take isl_basic_map * ptr)8135 basic_map manage(__isl_take isl_basic_map *ptr) {
8136   if (!ptr)
8137     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8138   return basic_map(ptr);
8139 }
manage_copy(__isl_keep isl_basic_map * ptr)8140 basic_map manage_copy(__isl_keep isl_basic_map *ptr) {
8141   if (!ptr)
8142     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8143   auto saved_ctx = isl_basic_map_get_ctx(ptr);
8144   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8145   ptr = isl_basic_map_copy(ptr);
8146   if (!ptr)
8147     exception::throw_last_error(saved_ctx);
8148   return basic_map(ptr);
8149 }
8150 
basic_map()8151 basic_map::basic_map()
8152     : ptr(nullptr) {}
8153 
basic_map(const basic_map & obj)8154 basic_map::basic_map(const basic_map &obj)
8155     : ptr(nullptr)
8156 {
8157   if (!obj.ptr)
8158     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8159   auto saved_ctx = isl_basic_map_get_ctx(obj.ptr);
8160   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8161   ptr = obj.copy();
8162   if (!ptr)
8163     exception::throw_last_error(saved_ctx);
8164 }
8165 
basic_map(__isl_take isl_basic_map * ptr)8166 basic_map::basic_map(__isl_take isl_basic_map *ptr)
8167     : ptr(ptr) {}
8168 
basic_map(isl::ctx ctx,const std::string & str)8169 basic_map::basic_map(isl::ctx ctx, const std::string &str)
8170 {
8171   auto saved_ctx = ctx;
8172   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8173   auto res = isl_basic_map_read_from_str(ctx.release(), str.c_str());
8174   if (!res)
8175     exception::throw_last_error(saved_ctx);
8176   ptr = res;
8177 }
8178 
8179 basic_map &basic_map::operator=(basic_map obj) {
8180   std::swap(this->ptr, obj.ptr);
8181   return *this;
8182 }
8183 
~basic_map()8184 basic_map::~basic_map() {
8185   if (ptr)
8186     isl_basic_map_free(ptr);
8187 }
8188 
copy()8189 __isl_give isl_basic_map *basic_map::copy() const & {
8190   return isl_basic_map_copy(ptr);
8191 }
8192 
get()8193 __isl_keep isl_basic_map *basic_map::get() const {
8194   return ptr;
8195 }
8196 
release()8197 __isl_give isl_basic_map *basic_map::release() {
8198   isl_basic_map *tmp = ptr;
8199   ptr = nullptr;
8200   return tmp;
8201 }
8202 
is_null()8203 bool basic_map::is_null() const {
8204   return ptr == nullptr;
8205 }
8206 
ctx()8207 isl::ctx basic_map::ctx() const {
8208   return isl::ctx(isl_basic_map_get_ctx(ptr));
8209 }
8210 
affine_hull()8211 isl::basic_map basic_map::affine_hull() const
8212 {
8213   if (!ptr)
8214     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8215   auto saved_ctx = ctx();
8216   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8217   auto res = isl_basic_map_affine_hull(copy());
8218   if (!res)
8219     exception::throw_last_error(saved_ctx);
8220   return manage(res);
8221 }
8222 
apply_domain(isl::basic_map bmap2)8223 isl::basic_map basic_map::apply_domain(isl::basic_map bmap2) const
8224 {
8225   if (!ptr || bmap2.is_null())
8226     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8227   auto saved_ctx = ctx();
8228   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8229   auto res = isl_basic_map_apply_domain(copy(), bmap2.release());
8230   if (!res)
8231     exception::throw_last_error(saved_ctx);
8232   return manage(res);
8233 }
8234 
apply_domain(const isl::map & map2)8235 isl::map basic_map::apply_domain(const isl::map &map2) const
8236 {
8237   if (!ptr)
8238     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8239   return isl::map(*this).apply_domain(map2);
8240 }
8241 
apply_domain(const isl::union_map & umap2)8242 isl::union_map basic_map::apply_domain(const isl::union_map &umap2) const
8243 {
8244   if (!ptr)
8245     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8246   return isl::map(*this).apply_domain(umap2);
8247 }
8248 
apply_range(isl::basic_map bmap2)8249 isl::basic_map basic_map::apply_range(isl::basic_map bmap2) const
8250 {
8251   if (!ptr || bmap2.is_null())
8252     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8253   auto saved_ctx = ctx();
8254   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8255   auto res = isl_basic_map_apply_range(copy(), bmap2.release());
8256   if (!res)
8257     exception::throw_last_error(saved_ctx);
8258   return manage(res);
8259 }
8260 
apply_range(const isl::map & map2)8261 isl::map basic_map::apply_range(const isl::map &map2) const
8262 {
8263   if (!ptr)
8264     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8265   return isl::map(*this).apply_range(map2);
8266 }
8267 
apply_range(const isl::union_map & umap2)8268 isl::union_map basic_map::apply_range(const isl::union_map &umap2) const
8269 {
8270   if (!ptr)
8271     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8272   return isl::map(*this).apply_range(umap2);
8273 }
8274 
as_map()8275 isl::map basic_map::as_map() const
8276 {
8277   if (!ptr)
8278     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8279   return isl::map(*this).as_map();
8280 }
8281 
as_multi_union_pw_aff()8282 isl::multi_union_pw_aff basic_map::as_multi_union_pw_aff() const
8283 {
8284   if (!ptr)
8285     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8286   return isl::map(*this).as_multi_union_pw_aff();
8287 }
8288 
as_pw_multi_aff()8289 isl::pw_multi_aff basic_map::as_pw_multi_aff() const
8290 {
8291   if (!ptr)
8292     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8293   return isl::map(*this).as_pw_multi_aff();
8294 }
8295 
as_union_pw_multi_aff()8296 isl::union_pw_multi_aff basic_map::as_union_pw_multi_aff() const
8297 {
8298   if (!ptr)
8299     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8300   return isl::map(*this).as_union_pw_multi_aff();
8301 }
8302 
bind_domain(const isl::multi_id & tuple)8303 isl::set basic_map::bind_domain(const isl::multi_id &tuple) const
8304 {
8305   if (!ptr)
8306     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8307   return isl::map(*this).bind_domain(tuple);
8308 }
8309 
bind_range(const isl::multi_id & tuple)8310 isl::set basic_map::bind_range(const isl::multi_id &tuple) const
8311 {
8312   if (!ptr)
8313     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8314   return isl::map(*this).bind_range(tuple);
8315 }
8316 
coalesce()8317 isl::map basic_map::coalesce() const
8318 {
8319   if (!ptr)
8320     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8321   return isl::map(*this).coalesce();
8322 }
8323 
complement()8324 isl::map basic_map::complement() const
8325 {
8326   if (!ptr)
8327     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8328   return isl::map(*this).complement();
8329 }
8330 
compute_divs()8331 isl::union_map basic_map::compute_divs() const
8332 {
8333   if (!ptr)
8334     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8335   return isl::map(*this).compute_divs();
8336 }
8337 
curry()8338 isl::map basic_map::curry() const
8339 {
8340   if (!ptr)
8341     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8342   return isl::map(*this).curry();
8343 }
8344 
deltas()8345 isl::basic_set basic_map::deltas() const
8346 {
8347   if (!ptr)
8348     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8349   auto saved_ctx = ctx();
8350   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8351   auto res = isl_basic_map_deltas(copy());
8352   if (!res)
8353     exception::throw_last_error(saved_ctx);
8354   return manage(res);
8355 }
8356 
detect_equalities()8357 isl::basic_map basic_map::detect_equalities() const
8358 {
8359   if (!ptr)
8360     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8361   auto saved_ctx = ctx();
8362   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8363   auto res = isl_basic_map_detect_equalities(copy());
8364   if (!res)
8365     exception::throw_last_error(saved_ctx);
8366   return manage(res);
8367 }
8368 
domain()8369 isl::set basic_map::domain() const
8370 {
8371   if (!ptr)
8372     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8373   return isl::map(*this).domain();
8374 }
8375 
domain_factor_domain()8376 isl::map basic_map::domain_factor_domain() const
8377 {
8378   if (!ptr)
8379     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8380   return isl::map(*this).domain_factor_domain();
8381 }
8382 
domain_factor_range()8383 isl::map basic_map::domain_factor_range() const
8384 {
8385   if (!ptr)
8386     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8387   return isl::map(*this).domain_factor_range();
8388 }
8389 
domain_map()8390 isl::union_map basic_map::domain_map() const
8391 {
8392   if (!ptr)
8393     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8394   return isl::map(*this).domain_map();
8395 }
8396 
domain_map_union_pw_multi_aff()8397 isl::union_pw_multi_aff basic_map::domain_map_union_pw_multi_aff() const
8398 {
8399   if (!ptr)
8400     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8401   return isl::map(*this).domain_map_union_pw_multi_aff();
8402 }
8403 
domain_product(const isl::map & map2)8404 isl::map basic_map::domain_product(const isl::map &map2) const
8405 {
8406   if (!ptr)
8407     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8408   return isl::map(*this).domain_product(map2);
8409 }
8410 
domain_product(const isl::union_map & umap2)8411 isl::union_map basic_map::domain_product(const isl::union_map &umap2) const
8412 {
8413   if (!ptr)
8414     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8415   return isl::map(*this).domain_product(umap2);
8416 }
8417 
domain_tuple_dim()8418 unsigned basic_map::domain_tuple_dim() const
8419 {
8420   if (!ptr)
8421     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8422   return isl::map(*this).domain_tuple_dim();
8423 }
8424 
domain_tuple_id()8425 isl::id basic_map::domain_tuple_id() const
8426 {
8427   if (!ptr)
8428     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8429   return isl::map(*this).domain_tuple_id();
8430 }
8431 
eq_at(const isl::multi_pw_aff & mpa)8432 isl::map basic_map::eq_at(const isl::multi_pw_aff &mpa) const
8433 {
8434   if (!ptr)
8435     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8436   return isl::map(*this).eq_at(mpa);
8437 }
8438 
eq_at(const isl::multi_union_pw_aff & mupa)8439 isl::union_map basic_map::eq_at(const isl::multi_union_pw_aff &mupa) const
8440 {
8441   if (!ptr)
8442     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8443   return isl::map(*this).eq_at(mupa);
8444 }
8445 
every_map(const std::function<bool (isl::map)> & test)8446 bool basic_map::every_map(const std::function<bool(isl::map)> &test) const
8447 {
8448   if (!ptr)
8449     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8450   return isl::map(*this).every_map(test);
8451 }
8452 
extract_map(const isl::space & space)8453 isl::map basic_map::extract_map(const isl::space &space) const
8454 {
8455   if (!ptr)
8456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8457   return isl::map(*this).extract_map(space);
8458 }
8459 
factor_domain()8460 isl::map basic_map::factor_domain() const
8461 {
8462   if (!ptr)
8463     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8464   return isl::map(*this).factor_domain();
8465 }
8466 
factor_range()8467 isl::map basic_map::factor_range() const
8468 {
8469   if (!ptr)
8470     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8471   return isl::map(*this).factor_range();
8472 }
8473 
fixed_power(const isl::val & exp)8474 isl::union_map basic_map::fixed_power(const isl::val &exp) const
8475 {
8476   if (!ptr)
8477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8478   return isl::map(*this).fixed_power(exp);
8479 }
8480 
fixed_power(long exp)8481 isl::union_map basic_map::fixed_power(long exp) const
8482 {
8483   if (!ptr)
8484     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8485   return this->fixed_power(isl::val(ctx(), exp));
8486 }
8487 
flatten()8488 isl::basic_map basic_map::flatten() const
8489 {
8490   if (!ptr)
8491     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8492   auto saved_ctx = ctx();
8493   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8494   auto res = isl_basic_map_flatten(copy());
8495   if (!res)
8496     exception::throw_last_error(saved_ctx);
8497   return manage(res);
8498 }
8499 
flatten_domain()8500 isl::basic_map basic_map::flatten_domain() const
8501 {
8502   if (!ptr)
8503     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8504   auto saved_ctx = ctx();
8505   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8506   auto res = isl_basic_map_flatten_domain(copy());
8507   if (!res)
8508     exception::throw_last_error(saved_ctx);
8509   return manage(res);
8510 }
8511 
flatten_range()8512 isl::basic_map basic_map::flatten_range() const
8513 {
8514   if (!ptr)
8515     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8516   auto saved_ctx = ctx();
8517   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8518   auto res = isl_basic_map_flatten_range(copy());
8519   if (!res)
8520     exception::throw_last_error(saved_ctx);
8521   return manage(res);
8522 }
8523 
foreach_basic_map(const std::function<void (isl::basic_map)> & fn)8524 void basic_map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
8525 {
8526   if (!ptr)
8527     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8528   return isl::map(*this).foreach_basic_map(fn);
8529 }
8530 
foreach_map(const std::function<void (isl::map)> & fn)8531 void basic_map::foreach_map(const std::function<void(isl::map)> &fn) const
8532 {
8533   if (!ptr)
8534     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8535   return isl::map(*this).foreach_map(fn);
8536 }
8537 
gist(isl::basic_map context)8538 isl::basic_map basic_map::gist(isl::basic_map context) const
8539 {
8540   if (!ptr || context.is_null())
8541     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8542   auto saved_ctx = ctx();
8543   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8544   auto res = isl_basic_map_gist(copy(), context.release());
8545   if (!res)
8546     exception::throw_last_error(saved_ctx);
8547   return manage(res);
8548 }
8549 
gist(const isl::map & context)8550 isl::map basic_map::gist(const isl::map &context) const
8551 {
8552   if (!ptr)
8553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8554   return isl::map(*this).gist(context);
8555 }
8556 
gist(const isl::union_map & context)8557 isl::union_map basic_map::gist(const isl::union_map &context) const
8558 {
8559   if (!ptr)
8560     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8561   return isl::map(*this).gist(context);
8562 }
8563 
gist_domain(const isl::set & context)8564 isl::map basic_map::gist_domain(const isl::set &context) const
8565 {
8566   if (!ptr)
8567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8568   return isl::map(*this).gist_domain(context);
8569 }
8570 
gist_domain(const isl::union_set & uset)8571 isl::union_map basic_map::gist_domain(const isl::union_set &uset) const
8572 {
8573   if (!ptr)
8574     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8575   return isl::map(*this).gist_domain(uset);
8576 }
8577 
gist_params(const isl::set & set)8578 isl::union_map basic_map::gist_params(const isl::set &set) const
8579 {
8580   if (!ptr)
8581     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8582   return isl::map(*this).gist_params(set);
8583 }
8584 
gist_range(const isl::union_set & uset)8585 isl::union_map basic_map::gist_range(const isl::union_set &uset) const
8586 {
8587   if (!ptr)
8588     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8589   return isl::map(*this).gist_range(uset);
8590 }
8591 
has_domain_tuple_id()8592 bool basic_map::has_domain_tuple_id() const
8593 {
8594   if (!ptr)
8595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8596   return isl::map(*this).has_domain_tuple_id();
8597 }
8598 
has_range_tuple_id()8599 bool basic_map::has_range_tuple_id() const
8600 {
8601   if (!ptr)
8602     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8603   return isl::map(*this).has_range_tuple_id();
8604 }
8605 
intersect(isl::basic_map bmap2)8606 isl::basic_map basic_map::intersect(isl::basic_map bmap2) const
8607 {
8608   if (!ptr || bmap2.is_null())
8609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8610   auto saved_ctx = ctx();
8611   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8612   auto res = isl_basic_map_intersect(copy(), bmap2.release());
8613   if (!res)
8614     exception::throw_last_error(saved_ctx);
8615   return manage(res);
8616 }
8617 
intersect(const isl::map & map2)8618 isl::map basic_map::intersect(const isl::map &map2) const
8619 {
8620   if (!ptr)
8621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8622   return isl::map(*this).intersect(map2);
8623 }
8624 
intersect(const isl::union_map & umap2)8625 isl::union_map basic_map::intersect(const isl::union_map &umap2) const
8626 {
8627   if (!ptr)
8628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8629   return isl::map(*this).intersect(umap2);
8630 }
8631 
intersect_domain(isl::basic_set bset)8632 isl::basic_map basic_map::intersect_domain(isl::basic_set bset) const
8633 {
8634   if (!ptr || bset.is_null())
8635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8636   auto saved_ctx = ctx();
8637   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8638   auto res = isl_basic_map_intersect_domain(copy(), bset.release());
8639   if (!res)
8640     exception::throw_last_error(saved_ctx);
8641   return manage(res);
8642 }
8643 
intersect_domain(const isl::set & set)8644 isl::map basic_map::intersect_domain(const isl::set &set) const
8645 {
8646   if (!ptr)
8647     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8648   return isl::map(*this).intersect_domain(set);
8649 }
8650 
intersect_domain(const isl::space & space)8651 isl::union_map basic_map::intersect_domain(const isl::space &space) const
8652 {
8653   if (!ptr)
8654     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8655   return isl::map(*this).intersect_domain(space);
8656 }
8657 
intersect_domain(const isl::union_set & uset)8658 isl::union_map basic_map::intersect_domain(const isl::union_set &uset) const
8659 {
8660   if (!ptr)
8661     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8662   return isl::map(*this).intersect_domain(uset);
8663 }
8664 
intersect_domain(const isl::point & bset)8665 isl::basic_map basic_map::intersect_domain(const isl::point &bset) const
8666 {
8667   if (!ptr)
8668     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8669   return this->intersect_domain(isl::basic_set(bset));
8670 }
8671 
intersect_domain_factor_domain(const isl::map & factor)8672 isl::map basic_map::intersect_domain_factor_domain(const isl::map &factor) const
8673 {
8674   if (!ptr)
8675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8676   return isl::map(*this).intersect_domain_factor_domain(factor);
8677 }
8678 
intersect_domain_factor_domain(const isl::union_map & factor)8679 isl::union_map basic_map::intersect_domain_factor_domain(const isl::union_map &factor) const
8680 {
8681   if (!ptr)
8682     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8683   return isl::map(*this).intersect_domain_factor_domain(factor);
8684 }
8685 
intersect_domain_factor_range(const isl::map & factor)8686 isl::map basic_map::intersect_domain_factor_range(const isl::map &factor) const
8687 {
8688   if (!ptr)
8689     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8690   return isl::map(*this).intersect_domain_factor_range(factor);
8691 }
8692 
intersect_domain_factor_range(const isl::union_map & factor)8693 isl::union_map basic_map::intersect_domain_factor_range(const isl::union_map &factor) const
8694 {
8695   if (!ptr)
8696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8697   return isl::map(*this).intersect_domain_factor_range(factor);
8698 }
8699 
intersect_params(const isl::set & params)8700 isl::map basic_map::intersect_params(const isl::set &params) const
8701 {
8702   if (!ptr)
8703     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8704   return isl::map(*this).intersect_params(params);
8705 }
8706 
intersect_range(isl::basic_set bset)8707 isl::basic_map basic_map::intersect_range(isl::basic_set bset) const
8708 {
8709   if (!ptr || bset.is_null())
8710     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8711   auto saved_ctx = ctx();
8712   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8713   auto res = isl_basic_map_intersect_range(copy(), bset.release());
8714   if (!res)
8715     exception::throw_last_error(saved_ctx);
8716   return manage(res);
8717 }
8718 
intersect_range(const isl::set & set)8719 isl::map basic_map::intersect_range(const isl::set &set) const
8720 {
8721   if (!ptr)
8722     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8723   return isl::map(*this).intersect_range(set);
8724 }
8725 
intersect_range(const isl::space & space)8726 isl::union_map basic_map::intersect_range(const isl::space &space) const
8727 {
8728   if (!ptr)
8729     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8730   return isl::map(*this).intersect_range(space);
8731 }
8732 
intersect_range(const isl::union_set & uset)8733 isl::union_map basic_map::intersect_range(const isl::union_set &uset) const
8734 {
8735   if (!ptr)
8736     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8737   return isl::map(*this).intersect_range(uset);
8738 }
8739 
intersect_range(const isl::point & bset)8740 isl::basic_map basic_map::intersect_range(const isl::point &bset) const
8741 {
8742   if (!ptr)
8743     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8744   return this->intersect_range(isl::basic_set(bset));
8745 }
8746 
intersect_range_factor_domain(const isl::map & factor)8747 isl::map basic_map::intersect_range_factor_domain(const isl::map &factor) const
8748 {
8749   if (!ptr)
8750     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8751   return isl::map(*this).intersect_range_factor_domain(factor);
8752 }
8753 
intersect_range_factor_domain(const isl::union_map & factor)8754 isl::union_map basic_map::intersect_range_factor_domain(const isl::union_map &factor) const
8755 {
8756   if (!ptr)
8757     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8758   return isl::map(*this).intersect_range_factor_domain(factor);
8759 }
8760 
intersect_range_factor_range(const isl::map & factor)8761 isl::map basic_map::intersect_range_factor_range(const isl::map &factor) const
8762 {
8763   if (!ptr)
8764     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8765   return isl::map(*this).intersect_range_factor_range(factor);
8766 }
8767 
intersect_range_factor_range(const isl::union_map & factor)8768 isl::union_map basic_map::intersect_range_factor_range(const isl::union_map &factor) const
8769 {
8770   if (!ptr)
8771     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8772   return isl::map(*this).intersect_range_factor_range(factor);
8773 }
8774 
is_bijective()8775 bool basic_map::is_bijective() const
8776 {
8777   if (!ptr)
8778     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8779   return isl::map(*this).is_bijective();
8780 }
8781 
is_disjoint(const isl::map & map2)8782 bool basic_map::is_disjoint(const isl::map &map2) const
8783 {
8784   if (!ptr)
8785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8786   return isl::map(*this).is_disjoint(map2);
8787 }
8788 
is_disjoint(const isl::union_map & umap2)8789 bool basic_map::is_disjoint(const isl::union_map &umap2) const
8790 {
8791   if (!ptr)
8792     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8793   return isl::map(*this).is_disjoint(umap2);
8794 }
8795 
is_empty()8796 bool basic_map::is_empty() const
8797 {
8798   if (!ptr)
8799     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8800   auto saved_ctx = ctx();
8801   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8802   auto res = isl_basic_map_is_empty(get());
8803   if (res < 0)
8804     exception::throw_last_error(saved_ctx);
8805   return res;
8806 }
8807 
is_equal(const isl::basic_map & bmap2)8808 bool basic_map::is_equal(const isl::basic_map &bmap2) const
8809 {
8810   if (!ptr || bmap2.is_null())
8811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8812   auto saved_ctx = ctx();
8813   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8814   auto res = isl_basic_map_is_equal(get(), bmap2.get());
8815   if (res < 0)
8816     exception::throw_last_error(saved_ctx);
8817   return res;
8818 }
8819 
is_equal(const isl::map & map2)8820 bool basic_map::is_equal(const isl::map &map2) const
8821 {
8822   if (!ptr)
8823     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8824   return isl::map(*this).is_equal(map2);
8825 }
8826 
is_equal(const isl::union_map & umap2)8827 bool basic_map::is_equal(const isl::union_map &umap2) const
8828 {
8829   if (!ptr)
8830     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8831   return isl::map(*this).is_equal(umap2);
8832 }
8833 
is_injective()8834 bool basic_map::is_injective() const
8835 {
8836   if (!ptr)
8837     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8838   return isl::map(*this).is_injective();
8839 }
8840 
is_single_valued()8841 bool basic_map::is_single_valued() const
8842 {
8843   if (!ptr)
8844     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8845   return isl::map(*this).is_single_valued();
8846 }
8847 
is_strict_subset(const isl::map & map2)8848 bool basic_map::is_strict_subset(const isl::map &map2) const
8849 {
8850   if (!ptr)
8851     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8852   return isl::map(*this).is_strict_subset(map2);
8853 }
8854 
is_strict_subset(const isl::union_map & umap2)8855 bool basic_map::is_strict_subset(const isl::union_map &umap2) const
8856 {
8857   if (!ptr)
8858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8859   return isl::map(*this).is_strict_subset(umap2);
8860 }
8861 
is_subset(const isl::basic_map & bmap2)8862 bool basic_map::is_subset(const isl::basic_map &bmap2) const
8863 {
8864   if (!ptr || bmap2.is_null())
8865     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8866   auto saved_ctx = ctx();
8867   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8868   auto res = isl_basic_map_is_subset(get(), bmap2.get());
8869   if (res < 0)
8870     exception::throw_last_error(saved_ctx);
8871   return res;
8872 }
8873 
is_subset(const isl::map & map2)8874 bool basic_map::is_subset(const isl::map &map2) const
8875 {
8876   if (!ptr)
8877     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8878   return isl::map(*this).is_subset(map2);
8879 }
8880 
is_subset(const isl::union_map & umap2)8881 bool basic_map::is_subset(const isl::union_map &umap2) const
8882 {
8883   if (!ptr)
8884     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8885   return isl::map(*this).is_subset(umap2);
8886 }
8887 
isa_map()8888 bool basic_map::isa_map() const
8889 {
8890   if (!ptr)
8891     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8892   return isl::map(*this).isa_map();
8893 }
8894 
lex_ge_at(const isl::multi_pw_aff & mpa)8895 isl::map basic_map::lex_ge_at(const isl::multi_pw_aff &mpa) const
8896 {
8897   if (!ptr)
8898     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8899   return isl::map(*this).lex_ge_at(mpa);
8900 }
8901 
lex_gt_at(const isl::multi_pw_aff & mpa)8902 isl::map basic_map::lex_gt_at(const isl::multi_pw_aff &mpa) const
8903 {
8904   if (!ptr)
8905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8906   return isl::map(*this).lex_gt_at(mpa);
8907 }
8908 
lex_le_at(const isl::multi_pw_aff & mpa)8909 isl::map basic_map::lex_le_at(const isl::multi_pw_aff &mpa) const
8910 {
8911   if (!ptr)
8912     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8913   return isl::map(*this).lex_le_at(mpa);
8914 }
8915 
lex_lt_at(const isl::multi_pw_aff & mpa)8916 isl::map basic_map::lex_lt_at(const isl::multi_pw_aff &mpa) const
8917 {
8918   if (!ptr)
8919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8920   return isl::map(*this).lex_lt_at(mpa);
8921 }
8922 
lexmax()8923 isl::map basic_map::lexmax() const
8924 {
8925   if (!ptr)
8926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8927   auto saved_ctx = ctx();
8928   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8929   auto res = isl_basic_map_lexmax(copy());
8930   if (!res)
8931     exception::throw_last_error(saved_ctx);
8932   return manage(res);
8933 }
8934 
lexmax_pw_multi_aff()8935 isl::pw_multi_aff basic_map::lexmax_pw_multi_aff() const
8936 {
8937   if (!ptr)
8938     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8939   return isl::map(*this).lexmax_pw_multi_aff();
8940 }
8941 
lexmin()8942 isl::map basic_map::lexmin() const
8943 {
8944   if (!ptr)
8945     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8946   auto saved_ctx = ctx();
8947   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8948   auto res = isl_basic_map_lexmin(copy());
8949   if (!res)
8950     exception::throw_last_error(saved_ctx);
8951   return manage(res);
8952 }
8953 
lexmin_pw_multi_aff()8954 isl::pw_multi_aff basic_map::lexmin_pw_multi_aff() const
8955 {
8956   if (!ptr)
8957     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8958   return isl::map(*this).lexmin_pw_multi_aff();
8959 }
8960 
lower_bound(const isl::multi_pw_aff & lower)8961 isl::map basic_map::lower_bound(const isl::multi_pw_aff &lower) const
8962 {
8963   if (!ptr)
8964     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8965   return isl::map(*this).lower_bound(lower);
8966 }
8967 
map_list()8968 isl::map_list basic_map::map_list() const
8969 {
8970   if (!ptr)
8971     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8972   return isl::map(*this).map_list();
8973 }
8974 
max_multi_pw_aff()8975 isl::multi_pw_aff basic_map::max_multi_pw_aff() const
8976 {
8977   if (!ptr)
8978     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8979   return isl::map(*this).max_multi_pw_aff();
8980 }
8981 
min_multi_pw_aff()8982 isl::multi_pw_aff basic_map::min_multi_pw_aff() const
8983 {
8984   if (!ptr)
8985     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8986   return isl::map(*this).min_multi_pw_aff();
8987 }
8988 
n_basic_map()8989 unsigned basic_map::n_basic_map() const
8990 {
8991   if (!ptr)
8992     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8993   return isl::map(*this).n_basic_map();
8994 }
8995 
polyhedral_hull()8996 isl::basic_map basic_map::polyhedral_hull() const
8997 {
8998   if (!ptr)
8999     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9000   return isl::map(*this).polyhedral_hull();
9001 }
9002 
preimage_domain(const isl::multi_aff & ma)9003 isl::map basic_map::preimage_domain(const isl::multi_aff &ma) const
9004 {
9005   if (!ptr)
9006     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9007   return isl::map(*this).preimage_domain(ma);
9008 }
9009 
preimage_domain(const isl::multi_pw_aff & mpa)9010 isl::map basic_map::preimage_domain(const isl::multi_pw_aff &mpa) const
9011 {
9012   if (!ptr)
9013     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9014   return isl::map(*this).preimage_domain(mpa);
9015 }
9016 
preimage_domain(const isl::pw_multi_aff & pma)9017 isl::map basic_map::preimage_domain(const isl::pw_multi_aff &pma) const
9018 {
9019   if (!ptr)
9020     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9021   return isl::map(*this).preimage_domain(pma);
9022 }
9023 
preimage_domain(const isl::union_pw_multi_aff & upma)9024 isl::union_map basic_map::preimage_domain(const isl::union_pw_multi_aff &upma) const
9025 {
9026   if (!ptr)
9027     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9028   return isl::map(*this).preimage_domain(upma);
9029 }
9030 
preimage_range(const isl::multi_aff & ma)9031 isl::map basic_map::preimage_range(const isl::multi_aff &ma) const
9032 {
9033   if (!ptr)
9034     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9035   return isl::map(*this).preimage_range(ma);
9036 }
9037 
preimage_range(const isl::pw_multi_aff & pma)9038 isl::map basic_map::preimage_range(const isl::pw_multi_aff &pma) const
9039 {
9040   if (!ptr)
9041     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9042   return isl::map(*this).preimage_range(pma);
9043 }
9044 
preimage_range(const isl::union_pw_multi_aff & upma)9045 isl::union_map basic_map::preimage_range(const isl::union_pw_multi_aff &upma) const
9046 {
9047   if (!ptr)
9048     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9049   return isl::map(*this).preimage_range(upma);
9050 }
9051 
product(const isl::map & map2)9052 isl::map basic_map::product(const isl::map &map2) const
9053 {
9054   if (!ptr)
9055     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9056   return isl::map(*this).product(map2);
9057 }
9058 
product(const isl::union_map & umap2)9059 isl::union_map basic_map::product(const isl::union_map &umap2) const
9060 {
9061   if (!ptr)
9062     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9063   return isl::map(*this).product(umap2);
9064 }
9065 
project_out_all_params()9066 isl::map basic_map::project_out_all_params() const
9067 {
9068   if (!ptr)
9069     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9070   return isl::map(*this).project_out_all_params();
9071 }
9072 
range()9073 isl::set basic_map::range() const
9074 {
9075   if (!ptr)
9076     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9077   return isl::map(*this).range();
9078 }
9079 
range_factor_domain()9080 isl::map basic_map::range_factor_domain() const
9081 {
9082   if (!ptr)
9083     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9084   return isl::map(*this).range_factor_domain();
9085 }
9086 
range_factor_range()9087 isl::map basic_map::range_factor_range() const
9088 {
9089   if (!ptr)
9090     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9091   return isl::map(*this).range_factor_range();
9092 }
9093 
range_lattice_tile()9094 isl::fixed_box basic_map::range_lattice_tile() const
9095 {
9096   if (!ptr)
9097     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9098   return isl::map(*this).range_lattice_tile();
9099 }
9100 
range_map()9101 isl::union_map basic_map::range_map() const
9102 {
9103   if (!ptr)
9104     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9105   return isl::map(*this).range_map();
9106 }
9107 
range_product(const isl::map & map2)9108 isl::map basic_map::range_product(const isl::map &map2) const
9109 {
9110   if (!ptr)
9111     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9112   return isl::map(*this).range_product(map2);
9113 }
9114 
range_product(const isl::union_map & umap2)9115 isl::union_map basic_map::range_product(const isl::union_map &umap2) const
9116 {
9117   if (!ptr)
9118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9119   return isl::map(*this).range_product(umap2);
9120 }
9121 
range_reverse()9122 isl::map basic_map::range_reverse() const
9123 {
9124   if (!ptr)
9125     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9126   return isl::map(*this).range_reverse();
9127 }
9128 
range_simple_fixed_box_hull()9129 isl::fixed_box basic_map::range_simple_fixed_box_hull() const
9130 {
9131   if (!ptr)
9132     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9133   return isl::map(*this).range_simple_fixed_box_hull();
9134 }
9135 
range_tuple_dim()9136 unsigned basic_map::range_tuple_dim() const
9137 {
9138   if (!ptr)
9139     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9140   return isl::map(*this).range_tuple_dim();
9141 }
9142 
range_tuple_id()9143 isl::id basic_map::range_tuple_id() const
9144 {
9145   if (!ptr)
9146     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9147   return isl::map(*this).range_tuple_id();
9148 }
9149 
reverse()9150 isl::basic_map basic_map::reverse() const
9151 {
9152   if (!ptr)
9153     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9154   auto saved_ctx = ctx();
9155   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9156   auto res = isl_basic_map_reverse(copy());
9157   if (!res)
9158     exception::throw_last_error(saved_ctx);
9159   return manage(res);
9160 }
9161 
sample()9162 isl::basic_map basic_map::sample() const
9163 {
9164   if (!ptr)
9165     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9166   auto saved_ctx = ctx();
9167   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9168   auto res = isl_basic_map_sample(copy());
9169   if (!res)
9170     exception::throw_last_error(saved_ctx);
9171   return manage(res);
9172 }
9173 
set_domain_tuple(const isl::id & id)9174 isl::map basic_map::set_domain_tuple(const isl::id &id) const
9175 {
9176   if (!ptr)
9177     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9178   return isl::map(*this).set_domain_tuple(id);
9179 }
9180 
set_domain_tuple(const std::string & id)9181 isl::map basic_map::set_domain_tuple(const std::string &id) const
9182 {
9183   if (!ptr)
9184     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9185   return this->set_domain_tuple(isl::id(ctx(), id));
9186 }
9187 
set_range_tuple(const isl::id & id)9188 isl::map basic_map::set_range_tuple(const isl::id &id) const
9189 {
9190   if (!ptr)
9191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9192   return isl::map(*this).set_range_tuple(id);
9193 }
9194 
set_range_tuple(const std::string & id)9195 isl::map basic_map::set_range_tuple(const std::string &id) const
9196 {
9197   if (!ptr)
9198     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9199   return this->set_range_tuple(isl::id(ctx(), id));
9200 }
9201 
space()9202 isl::space basic_map::space() const
9203 {
9204   if (!ptr)
9205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9206   return isl::map(*this).space();
9207 }
9208 
subtract(const isl::map & map2)9209 isl::map basic_map::subtract(const isl::map &map2) const
9210 {
9211   if (!ptr)
9212     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9213   return isl::map(*this).subtract(map2);
9214 }
9215 
subtract(const isl::union_map & umap2)9216 isl::union_map basic_map::subtract(const isl::union_map &umap2) const
9217 {
9218   if (!ptr)
9219     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9220   return isl::map(*this).subtract(umap2);
9221 }
9222 
subtract_domain(const isl::union_set & dom)9223 isl::union_map basic_map::subtract_domain(const isl::union_set &dom) const
9224 {
9225   if (!ptr)
9226     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9227   return isl::map(*this).subtract_domain(dom);
9228 }
9229 
subtract_range(const isl::union_set & dom)9230 isl::union_map basic_map::subtract_range(const isl::union_set &dom) const
9231 {
9232   if (!ptr)
9233     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9234   return isl::map(*this).subtract_range(dom);
9235 }
9236 
to_list()9237 isl::map_list basic_map::to_list() const
9238 {
9239   if (!ptr)
9240     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9241   return isl::map(*this).to_list();
9242 }
9243 
to_union_map()9244 isl::union_map basic_map::to_union_map() const
9245 {
9246   if (!ptr)
9247     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9248   return isl::map(*this).to_union_map();
9249 }
9250 
uncurry()9251 isl::map basic_map::uncurry() const
9252 {
9253   if (!ptr)
9254     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9255   return isl::map(*this).uncurry();
9256 }
9257 
unite(isl::basic_map bmap2)9258 isl::map basic_map::unite(isl::basic_map bmap2) const
9259 {
9260   if (!ptr || bmap2.is_null())
9261     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9262   auto saved_ctx = ctx();
9263   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9264   auto res = isl_basic_map_union(copy(), bmap2.release());
9265   if (!res)
9266     exception::throw_last_error(saved_ctx);
9267   return manage(res);
9268 }
9269 
unite(const isl::map & map2)9270 isl::map basic_map::unite(const isl::map &map2) const
9271 {
9272   if (!ptr)
9273     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9274   return isl::map(*this).unite(map2);
9275 }
9276 
unite(const isl::union_map & umap2)9277 isl::union_map basic_map::unite(const isl::union_map &umap2) const
9278 {
9279   if (!ptr)
9280     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9281   return isl::map(*this).unite(umap2);
9282 }
9283 
unshifted_simple_hull()9284 isl::basic_map basic_map::unshifted_simple_hull() const
9285 {
9286   if (!ptr)
9287     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9288   return isl::map(*this).unshifted_simple_hull();
9289 }
9290 
upper_bound(const isl::multi_pw_aff & upper)9291 isl::map basic_map::upper_bound(const isl::multi_pw_aff &upper) const
9292 {
9293   if (!ptr)
9294     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9295   return isl::map(*this).upper_bound(upper);
9296 }
9297 
wrap()9298 isl::set basic_map::wrap() const
9299 {
9300   if (!ptr)
9301     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9302   return isl::map(*this).wrap();
9303 }
9304 
zip()9305 isl::map basic_map::zip() const
9306 {
9307   if (!ptr)
9308     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9309   return isl::map(*this).zip();
9310 }
9311 
9312 inline std::ostream &operator<<(std::ostream &os, const basic_map &obj)
9313 {
9314   if (!obj.get())
9315     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9316   auto saved_ctx = isl_basic_map_get_ctx(obj.get());
9317   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9318   char *str = isl_basic_map_to_str(obj.get());
9319   if (!str)
9320     exception::throw_last_error(saved_ctx);
9321   os << str;
9322   free(str);
9323   return os;
9324 }
9325 
9326 // implementations for isl::basic_set
manage(__isl_take isl_basic_set * ptr)9327 basic_set manage(__isl_take isl_basic_set *ptr) {
9328   if (!ptr)
9329     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9330   return basic_set(ptr);
9331 }
manage_copy(__isl_keep isl_basic_set * ptr)9332 basic_set manage_copy(__isl_keep isl_basic_set *ptr) {
9333   if (!ptr)
9334     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9335   auto saved_ctx = isl_basic_set_get_ctx(ptr);
9336   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9337   ptr = isl_basic_set_copy(ptr);
9338   if (!ptr)
9339     exception::throw_last_error(saved_ctx);
9340   return basic_set(ptr);
9341 }
9342 
basic_set()9343 basic_set::basic_set()
9344     : ptr(nullptr) {}
9345 
basic_set(const basic_set & obj)9346 basic_set::basic_set(const basic_set &obj)
9347     : ptr(nullptr)
9348 {
9349   if (!obj.ptr)
9350     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9351   auto saved_ctx = isl_basic_set_get_ctx(obj.ptr);
9352   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9353   ptr = obj.copy();
9354   if (!ptr)
9355     exception::throw_last_error(saved_ctx);
9356 }
9357 
basic_set(__isl_take isl_basic_set * ptr)9358 basic_set::basic_set(__isl_take isl_basic_set *ptr)
9359     : ptr(ptr) {}
9360 
basic_set(isl::point pnt)9361 basic_set::basic_set(isl::point pnt)
9362 {
9363   if (pnt.is_null())
9364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9365   auto saved_ctx = pnt.ctx();
9366   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9367   auto res = isl_basic_set_from_point(pnt.release());
9368   if (!res)
9369     exception::throw_last_error(saved_ctx);
9370   ptr = res;
9371 }
9372 
basic_set(isl::ctx ctx,const std::string & str)9373 basic_set::basic_set(isl::ctx ctx, const std::string &str)
9374 {
9375   auto saved_ctx = ctx;
9376   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9377   auto res = isl_basic_set_read_from_str(ctx.release(), str.c_str());
9378   if (!res)
9379     exception::throw_last_error(saved_ctx);
9380   ptr = res;
9381 }
9382 
9383 basic_set &basic_set::operator=(basic_set obj) {
9384   std::swap(this->ptr, obj.ptr);
9385   return *this;
9386 }
9387 
~basic_set()9388 basic_set::~basic_set() {
9389   if (ptr)
9390     isl_basic_set_free(ptr);
9391 }
9392 
copy()9393 __isl_give isl_basic_set *basic_set::copy() const & {
9394   return isl_basic_set_copy(ptr);
9395 }
9396 
get()9397 __isl_keep isl_basic_set *basic_set::get() const {
9398   return ptr;
9399 }
9400 
release()9401 __isl_give isl_basic_set *basic_set::release() {
9402   isl_basic_set *tmp = ptr;
9403   ptr = nullptr;
9404   return tmp;
9405 }
9406 
is_null()9407 bool basic_set::is_null() const {
9408   return ptr == nullptr;
9409 }
9410 
ctx()9411 isl::ctx basic_set::ctx() const {
9412   return isl::ctx(isl_basic_set_get_ctx(ptr));
9413 }
9414 
affine_hull()9415 isl::basic_set basic_set::affine_hull() const
9416 {
9417   if (!ptr)
9418     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9419   auto saved_ctx = ctx();
9420   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9421   auto res = isl_basic_set_affine_hull(copy());
9422   if (!res)
9423     exception::throw_last_error(saved_ctx);
9424   return manage(res);
9425 }
9426 
apply(isl::basic_map bmap)9427 isl::basic_set basic_set::apply(isl::basic_map bmap) const
9428 {
9429   if (!ptr || bmap.is_null())
9430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9431   auto saved_ctx = ctx();
9432   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9433   auto res = isl_basic_set_apply(copy(), bmap.release());
9434   if (!res)
9435     exception::throw_last_error(saved_ctx);
9436   return manage(res);
9437 }
9438 
apply(const isl::map & map)9439 isl::set basic_set::apply(const isl::map &map) const
9440 {
9441   if (!ptr)
9442     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9443   return isl::set(*this).apply(map);
9444 }
9445 
apply(const isl::union_map & umap)9446 isl::union_set basic_set::apply(const isl::union_map &umap) const
9447 {
9448   if (!ptr)
9449     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9450   return isl::set(*this).apply(umap);
9451 }
9452 
as_pw_multi_aff()9453 isl::pw_multi_aff basic_set::as_pw_multi_aff() const
9454 {
9455   if (!ptr)
9456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9457   return isl::set(*this).as_pw_multi_aff();
9458 }
9459 
as_set()9460 isl::set basic_set::as_set() const
9461 {
9462   if (!ptr)
9463     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9464   return isl::set(*this).as_set();
9465 }
9466 
bind(const isl::multi_id & tuple)9467 isl::set basic_set::bind(const isl::multi_id &tuple) const
9468 {
9469   if (!ptr)
9470     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9471   return isl::set(*this).bind(tuple);
9472 }
9473 
coalesce()9474 isl::set basic_set::coalesce() const
9475 {
9476   if (!ptr)
9477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9478   return isl::set(*this).coalesce();
9479 }
9480 
complement()9481 isl::set basic_set::complement() const
9482 {
9483   if (!ptr)
9484     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9485   return isl::set(*this).complement();
9486 }
9487 
compute_divs()9488 isl::union_set basic_set::compute_divs() const
9489 {
9490   if (!ptr)
9491     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9492   return isl::set(*this).compute_divs();
9493 }
9494 
detect_equalities()9495 isl::basic_set basic_set::detect_equalities() const
9496 {
9497   if (!ptr)
9498     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9499   auto saved_ctx = ctx();
9500   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9501   auto res = isl_basic_set_detect_equalities(copy());
9502   if (!res)
9503     exception::throw_last_error(saved_ctx);
9504   return manage(res);
9505 }
9506 
dim_max_val(int pos)9507 isl::val basic_set::dim_max_val(int pos) const
9508 {
9509   if (!ptr)
9510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9511   auto saved_ctx = ctx();
9512   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9513   auto res = isl_basic_set_dim_max_val(copy(), pos);
9514   if (!res)
9515     exception::throw_last_error(saved_ctx);
9516   return manage(res);
9517 }
9518 
dim_min_val(int pos)9519 isl::val basic_set::dim_min_val(int pos) const
9520 {
9521   if (!ptr)
9522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9523   return isl::set(*this).dim_min_val(pos);
9524 }
9525 
every_set(const std::function<bool (isl::set)> & test)9526 bool basic_set::every_set(const std::function<bool(isl::set)> &test) const
9527 {
9528   if (!ptr)
9529     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9530   return isl::set(*this).every_set(test);
9531 }
9532 
extract_set(const isl::space & space)9533 isl::set basic_set::extract_set(const isl::space &space) const
9534 {
9535   if (!ptr)
9536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9537   return isl::set(*this).extract_set(space);
9538 }
9539 
flatten()9540 isl::basic_set basic_set::flatten() const
9541 {
9542   if (!ptr)
9543     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9544   auto saved_ctx = ctx();
9545   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9546   auto res = isl_basic_set_flatten(copy());
9547   if (!res)
9548     exception::throw_last_error(saved_ctx);
9549   return manage(res);
9550 }
9551 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)9552 void basic_set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
9553 {
9554   if (!ptr)
9555     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9556   return isl::set(*this).foreach_basic_set(fn);
9557 }
9558 
foreach_point(const std::function<void (isl::point)> & fn)9559 void basic_set::foreach_point(const std::function<void(isl::point)> &fn) const
9560 {
9561   if (!ptr)
9562     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9563   return isl::set(*this).foreach_point(fn);
9564 }
9565 
foreach_set(const std::function<void (isl::set)> & fn)9566 void basic_set::foreach_set(const std::function<void(isl::set)> &fn) const
9567 {
9568   if (!ptr)
9569     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9570   return isl::set(*this).foreach_set(fn);
9571 }
9572 
gist(isl::basic_set context)9573 isl::basic_set basic_set::gist(isl::basic_set context) const
9574 {
9575   if (!ptr || context.is_null())
9576     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9577   auto saved_ctx = ctx();
9578   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9579   auto res = isl_basic_set_gist(copy(), context.release());
9580   if (!res)
9581     exception::throw_last_error(saved_ctx);
9582   return manage(res);
9583 }
9584 
gist(const isl::set & context)9585 isl::set basic_set::gist(const isl::set &context) const
9586 {
9587   if (!ptr)
9588     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9589   return isl::set(*this).gist(context);
9590 }
9591 
gist(const isl::union_set & context)9592 isl::union_set basic_set::gist(const isl::union_set &context) const
9593 {
9594   if (!ptr)
9595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9596   return isl::set(*this).gist(context);
9597 }
9598 
gist(const isl::point & context)9599 isl::basic_set basic_set::gist(const isl::point &context) const
9600 {
9601   if (!ptr)
9602     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9603   return this->gist(isl::basic_set(context));
9604 }
9605 
gist_params(const isl::set & set)9606 isl::union_set basic_set::gist_params(const isl::set &set) const
9607 {
9608   if (!ptr)
9609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9610   return isl::set(*this).gist_params(set);
9611 }
9612 
identity()9613 isl::map basic_set::identity() const
9614 {
9615   if (!ptr)
9616     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9617   return isl::set(*this).identity();
9618 }
9619 
indicator_function()9620 isl::pw_aff basic_set::indicator_function() const
9621 {
9622   if (!ptr)
9623     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9624   return isl::set(*this).indicator_function();
9625 }
9626 
insert_domain(const isl::space & domain)9627 isl::map basic_set::insert_domain(const isl::space &domain) const
9628 {
9629   if (!ptr)
9630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9631   return isl::set(*this).insert_domain(domain);
9632 }
9633 
intersect(isl::basic_set bset2)9634 isl::basic_set basic_set::intersect(isl::basic_set bset2) const
9635 {
9636   if (!ptr || bset2.is_null())
9637     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9638   auto saved_ctx = ctx();
9639   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9640   auto res = isl_basic_set_intersect(copy(), bset2.release());
9641   if (!res)
9642     exception::throw_last_error(saved_ctx);
9643   return manage(res);
9644 }
9645 
intersect(const isl::set & set2)9646 isl::set basic_set::intersect(const isl::set &set2) const
9647 {
9648   if (!ptr)
9649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9650   return isl::set(*this).intersect(set2);
9651 }
9652 
intersect(const isl::union_set & uset2)9653 isl::union_set basic_set::intersect(const isl::union_set &uset2) const
9654 {
9655   if (!ptr)
9656     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9657   return isl::set(*this).intersect(uset2);
9658 }
9659 
intersect(const isl::point & bset2)9660 isl::basic_set basic_set::intersect(const isl::point &bset2) const
9661 {
9662   if (!ptr)
9663     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9664   return this->intersect(isl::basic_set(bset2));
9665 }
9666 
intersect_params(isl::basic_set bset2)9667 isl::basic_set basic_set::intersect_params(isl::basic_set bset2) const
9668 {
9669   if (!ptr || bset2.is_null())
9670     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9671   auto saved_ctx = ctx();
9672   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9673   auto res = isl_basic_set_intersect_params(copy(), bset2.release());
9674   if (!res)
9675     exception::throw_last_error(saved_ctx);
9676   return manage(res);
9677 }
9678 
intersect_params(const isl::set & params)9679 isl::set basic_set::intersect_params(const isl::set &params) const
9680 {
9681   if (!ptr)
9682     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9683   return isl::set(*this).intersect_params(params);
9684 }
9685 
intersect_params(const isl::point & bset2)9686 isl::basic_set basic_set::intersect_params(const isl::point &bset2) const
9687 {
9688   if (!ptr)
9689     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9690   return this->intersect_params(isl::basic_set(bset2));
9691 }
9692 
involves_locals()9693 bool basic_set::involves_locals() const
9694 {
9695   if (!ptr)
9696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9697   return isl::set(*this).involves_locals();
9698 }
9699 
is_disjoint(const isl::set & set2)9700 bool basic_set::is_disjoint(const isl::set &set2) const
9701 {
9702   if (!ptr)
9703     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9704   return isl::set(*this).is_disjoint(set2);
9705 }
9706 
is_disjoint(const isl::union_set & uset2)9707 bool basic_set::is_disjoint(const isl::union_set &uset2) const
9708 {
9709   if (!ptr)
9710     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9711   return isl::set(*this).is_disjoint(uset2);
9712 }
9713 
is_empty()9714 bool basic_set::is_empty() const
9715 {
9716   if (!ptr)
9717     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9718   auto saved_ctx = ctx();
9719   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9720   auto res = isl_basic_set_is_empty(get());
9721   if (res < 0)
9722     exception::throw_last_error(saved_ctx);
9723   return res;
9724 }
9725 
is_equal(const isl::basic_set & bset2)9726 bool basic_set::is_equal(const isl::basic_set &bset2) const
9727 {
9728   if (!ptr || bset2.is_null())
9729     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9730   auto saved_ctx = ctx();
9731   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9732   auto res = isl_basic_set_is_equal(get(), bset2.get());
9733   if (res < 0)
9734     exception::throw_last_error(saved_ctx);
9735   return res;
9736 }
9737 
is_equal(const isl::set & set2)9738 bool basic_set::is_equal(const isl::set &set2) const
9739 {
9740   if (!ptr)
9741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9742   return isl::set(*this).is_equal(set2);
9743 }
9744 
is_equal(const isl::union_set & uset2)9745 bool basic_set::is_equal(const isl::union_set &uset2) const
9746 {
9747   if (!ptr)
9748     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9749   return isl::set(*this).is_equal(uset2);
9750 }
9751 
is_equal(const isl::point & bset2)9752 bool basic_set::is_equal(const isl::point &bset2) const
9753 {
9754   if (!ptr)
9755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9756   return this->is_equal(isl::basic_set(bset2));
9757 }
9758 
is_singleton()9759 bool basic_set::is_singleton() const
9760 {
9761   if (!ptr)
9762     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9763   return isl::set(*this).is_singleton();
9764 }
9765 
is_strict_subset(const isl::set & set2)9766 bool basic_set::is_strict_subset(const isl::set &set2) const
9767 {
9768   if (!ptr)
9769     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9770   return isl::set(*this).is_strict_subset(set2);
9771 }
9772 
is_strict_subset(const isl::union_set & uset2)9773 bool basic_set::is_strict_subset(const isl::union_set &uset2) const
9774 {
9775   if (!ptr)
9776     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9777   return isl::set(*this).is_strict_subset(uset2);
9778 }
9779 
is_subset(const isl::basic_set & bset2)9780 bool basic_set::is_subset(const isl::basic_set &bset2) const
9781 {
9782   if (!ptr || bset2.is_null())
9783     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9784   auto saved_ctx = ctx();
9785   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9786   auto res = isl_basic_set_is_subset(get(), bset2.get());
9787   if (res < 0)
9788     exception::throw_last_error(saved_ctx);
9789   return res;
9790 }
9791 
is_subset(const isl::set & set2)9792 bool basic_set::is_subset(const isl::set &set2) const
9793 {
9794   if (!ptr)
9795     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9796   return isl::set(*this).is_subset(set2);
9797 }
9798 
is_subset(const isl::union_set & uset2)9799 bool basic_set::is_subset(const isl::union_set &uset2) const
9800 {
9801   if (!ptr)
9802     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9803   return isl::set(*this).is_subset(uset2);
9804 }
9805 
is_subset(const isl::point & bset2)9806 bool basic_set::is_subset(const isl::point &bset2) const
9807 {
9808   if (!ptr)
9809     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9810   return this->is_subset(isl::basic_set(bset2));
9811 }
9812 
is_wrapping()9813 bool basic_set::is_wrapping() const
9814 {
9815   if (!ptr)
9816     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9817   auto saved_ctx = ctx();
9818   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9819   auto res = isl_basic_set_is_wrapping(get());
9820   if (res < 0)
9821     exception::throw_last_error(saved_ctx);
9822   return res;
9823 }
9824 
isa_set()9825 bool basic_set::isa_set() const
9826 {
9827   if (!ptr)
9828     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9829   return isl::set(*this).isa_set();
9830 }
9831 
lexmax()9832 isl::set basic_set::lexmax() const
9833 {
9834   if (!ptr)
9835     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9836   auto saved_ctx = ctx();
9837   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9838   auto res = isl_basic_set_lexmax(copy());
9839   if (!res)
9840     exception::throw_last_error(saved_ctx);
9841   return manage(res);
9842 }
9843 
lexmax_pw_multi_aff()9844 isl::pw_multi_aff basic_set::lexmax_pw_multi_aff() const
9845 {
9846   if (!ptr)
9847     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9848   return isl::set(*this).lexmax_pw_multi_aff();
9849 }
9850 
lexmin()9851 isl::set basic_set::lexmin() const
9852 {
9853   if (!ptr)
9854     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9855   auto saved_ctx = ctx();
9856   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9857   auto res = isl_basic_set_lexmin(copy());
9858   if (!res)
9859     exception::throw_last_error(saved_ctx);
9860   return manage(res);
9861 }
9862 
lexmin_pw_multi_aff()9863 isl::pw_multi_aff basic_set::lexmin_pw_multi_aff() const
9864 {
9865   if (!ptr)
9866     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9867   return isl::set(*this).lexmin_pw_multi_aff();
9868 }
9869 
lower_bound(const isl::multi_pw_aff & lower)9870 isl::set basic_set::lower_bound(const isl::multi_pw_aff &lower) const
9871 {
9872   if (!ptr)
9873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9874   return isl::set(*this).lower_bound(lower);
9875 }
9876 
lower_bound(const isl::multi_val & lower)9877 isl::set basic_set::lower_bound(const isl::multi_val &lower) const
9878 {
9879   if (!ptr)
9880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9881   return isl::set(*this).lower_bound(lower);
9882 }
9883 
max_multi_pw_aff()9884 isl::multi_pw_aff basic_set::max_multi_pw_aff() const
9885 {
9886   if (!ptr)
9887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9888   return isl::set(*this).max_multi_pw_aff();
9889 }
9890 
max_val(const isl::aff & obj)9891 isl::val basic_set::max_val(const isl::aff &obj) const
9892 {
9893   if (!ptr)
9894     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9895   return isl::set(*this).max_val(obj);
9896 }
9897 
min_multi_pw_aff()9898 isl::multi_pw_aff basic_set::min_multi_pw_aff() const
9899 {
9900   if (!ptr)
9901     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9902   return isl::set(*this).min_multi_pw_aff();
9903 }
9904 
min_val(const isl::aff & obj)9905 isl::val basic_set::min_val(const isl::aff &obj) const
9906 {
9907   if (!ptr)
9908     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9909   return isl::set(*this).min_val(obj);
9910 }
9911 
n_basic_set()9912 unsigned basic_set::n_basic_set() const
9913 {
9914   if (!ptr)
9915     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9916   return isl::set(*this).n_basic_set();
9917 }
9918 
params()9919 isl::basic_set basic_set::params() const
9920 {
9921   if (!ptr)
9922     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9923   auto saved_ctx = ctx();
9924   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9925   auto res = isl_basic_set_params(copy());
9926   if (!res)
9927     exception::throw_last_error(saved_ctx);
9928   return manage(res);
9929 }
9930 
plain_multi_val_if_fixed()9931 isl::multi_val basic_set::plain_multi_val_if_fixed() const
9932 {
9933   if (!ptr)
9934     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9935   return isl::set(*this).plain_multi_val_if_fixed();
9936 }
9937 
polyhedral_hull()9938 isl::basic_set basic_set::polyhedral_hull() const
9939 {
9940   if (!ptr)
9941     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9942   return isl::set(*this).polyhedral_hull();
9943 }
9944 
preimage(const isl::multi_aff & ma)9945 isl::set basic_set::preimage(const isl::multi_aff &ma) const
9946 {
9947   if (!ptr)
9948     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9949   return isl::set(*this).preimage(ma);
9950 }
9951 
preimage(const isl::multi_pw_aff & mpa)9952 isl::set basic_set::preimage(const isl::multi_pw_aff &mpa) const
9953 {
9954   if (!ptr)
9955     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9956   return isl::set(*this).preimage(mpa);
9957 }
9958 
preimage(const isl::pw_multi_aff & pma)9959 isl::set basic_set::preimage(const isl::pw_multi_aff &pma) const
9960 {
9961   if (!ptr)
9962     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9963   return isl::set(*this).preimage(pma);
9964 }
9965 
preimage(const isl::union_pw_multi_aff & upma)9966 isl::union_set basic_set::preimage(const isl::union_pw_multi_aff &upma) const
9967 {
9968   if (!ptr)
9969     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9970   return isl::set(*this).preimage(upma);
9971 }
9972 
product(const isl::set & set2)9973 isl::set basic_set::product(const isl::set &set2) const
9974 {
9975   if (!ptr)
9976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9977   return isl::set(*this).product(set2);
9978 }
9979 
project_out_all_params()9980 isl::set basic_set::project_out_all_params() const
9981 {
9982   if (!ptr)
9983     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9984   return isl::set(*this).project_out_all_params();
9985 }
9986 
project_out_param(const isl::id & id)9987 isl::set basic_set::project_out_param(const isl::id &id) const
9988 {
9989   if (!ptr)
9990     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9991   return isl::set(*this).project_out_param(id);
9992 }
9993 
project_out_param(const std::string & id)9994 isl::set basic_set::project_out_param(const std::string &id) const
9995 {
9996   if (!ptr)
9997     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9998   return this->project_out_param(isl::id(ctx(), id));
9999 }
10000 
project_out_param(const isl::id_list & list)10001 isl::set basic_set::project_out_param(const isl::id_list &list) const
10002 {
10003   if (!ptr)
10004     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10005   return isl::set(*this).project_out_param(list);
10006 }
10007 
pw_multi_aff_on_domain(const isl::multi_val & mv)10008 isl::pw_multi_aff basic_set::pw_multi_aff_on_domain(const isl::multi_val &mv) const
10009 {
10010   if (!ptr)
10011     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10012   return isl::set(*this).pw_multi_aff_on_domain(mv);
10013 }
10014 
sample()10015 isl::basic_set basic_set::sample() const
10016 {
10017   if (!ptr)
10018     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10019   auto saved_ctx = ctx();
10020   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10021   auto res = isl_basic_set_sample(copy());
10022   if (!res)
10023     exception::throw_last_error(saved_ctx);
10024   return manage(res);
10025 }
10026 
sample_point()10027 isl::point basic_set::sample_point() const
10028 {
10029   if (!ptr)
10030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10031   auto saved_ctx = ctx();
10032   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10033   auto res = isl_basic_set_sample_point(copy());
10034   if (!res)
10035     exception::throw_last_error(saved_ctx);
10036   return manage(res);
10037 }
10038 
set_list()10039 isl::set_list basic_set::set_list() const
10040 {
10041   if (!ptr)
10042     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10043   return isl::set(*this).set_list();
10044 }
10045 
simple_fixed_box_hull()10046 isl::fixed_box basic_set::simple_fixed_box_hull() const
10047 {
10048   if (!ptr)
10049     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10050   return isl::set(*this).simple_fixed_box_hull();
10051 }
10052 
space()10053 isl::space basic_set::space() const
10054 {
10055   if (!ptr)
10056     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10057   return isl::set(*this).space();
10058 }
10059 
stride(int pos)10060 isl::val basic_set::stride(int pos) const
10061 {
10062   if (!ptr)
10063     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10064   return isl::set(*this).stride(pos);
10065 }
10066 
subtract(const isl::set & set2)10067 isl::set basic_set::subtract(const isl::set &set2) const
10068 {
10069   if (!ptr)
10070     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10071   return isl::set(*this).subtract(set2);
10072 }
10073 
subtract(const isl::union_set & uset2)10074 isl::union_set basic_set::subtract(const isl::union_set &uset2) const
10075 {
10076   if (!ptr)
10077     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10078   return isl::set(*this).subtract(uset2);
10079 }
10080 
to_list()10081 isl::set_list basic_set::to_list() const
10082 {
10083   if (!ptr)
10084     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10085   return isl::set(*this).to_list();
10086 }
10087 
to_set()10088 isl::set basic_set::to_set() const
10089 {
10090   if (!ptr)
10091     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10092   auto saved_ctx = ctx();
10093   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10094   auto res = isl_basic_set_to_set(copy());
10095   if (!res)
10096     exception::throw_last_error(saved_ctx);
10097   return manage(res);
10098 }
10099 
to_union_set()10100 isl::union_set basic_set::to_union_set() const
10101 {
10102   if (!ptr)
10103     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10104   return isl::set(*this).to_union_set();
10105 }
10106 
translation()10107 isl::map basic_set::translation() const
10108 {
10109   if (!ptr)
10110     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10111   return isl::set(*this).translation();
10112 }
10113 
tuple_dim()10114 unsigned basic_set::tuple_dim() const
10115 {
10116   if (!ptr)
10117     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10118   return isl::set(*this).tuple_dim();
10119 }
10120 
unbind_params(const isl::multi_id & tuple)10121 isl::set basic_set::unbind_params(const isl::multi_id &tuple) const
10122 {
10123   if (!ptr)
10124     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10125   return isl::set(*this).unbind_params(tuple);
10126 }
10127 
unbind_params_insert_domain(const isl::multi_id & domain)10128 isl::map basic_set::unbind_params_insert_domain(const isl::multi_id &domain) const
10129 {
10130   if (!ptr)
10131     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10132   return isl::set(*this).unbind_params_insert_domain(domain);
10133 }
10134 
unite(isl::basic_set bset2)10135 isl::set basic_set::unite(isl::basic_set bset2) const
10136 {
10137   if (!ptr || bset2.is_null())
10138     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10139   auto saved_ctx = ctx();
10140   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10141   auto res = isl_basic_set_union(copy(), bset2.release());
10142   if (!res)
10143     exception::throw_last_error(saved_ctx);
10144   return manage(res);
10145 }
10146 
unite(const isl::set & set2)10147 isl::set basic_set::unite(const isl::set &set2) const
10148 {
10149   if (!ptr)
10150     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10151   return isl::set(*this).unite(set2);
10152 }
10153 
unite(const isl::union_set & uset2)10154 isl::union_set basic_set::unite(const isl::union_set &uset2) const
10155 {
10156   if (!ptr)
10157     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10158   return isl::set(*this).unite(uset2);
10159 }
10160 
unite(const isl::point & bset2)10161 isl::set basic_set::unite(const isl::point &bset2) const
10162 {
10163   if (!ptr)
10164     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10165   return this->unite(isl::basic_set(bset2));
10166 }
10167 
unshifted_simple_hull()10168 isl::basic_set basic_set::unshifted_simple_hull() const
10169 {
10170   if (!ptr)
10171     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10172   return isl::set(*this).unshifted_simple_hull();
10173 }
10174 
unwrap()10175 isl::map basic_set::unwrap() const
10176 {
10177   if (!ptr)
10178     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10179   return isl::set(*this).unwrap();
10180 }
10181 
upper_bound(const isl::multi_pw_aff & upper)10182 isl::set basic_set::upper_bound(const isl::multi_pw_aff &upper) const
10183 {
10184   if (!ptr)
10185     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10186   return isl::set(*this).upper_bound(upper);
10187 }
10188 
upper_bound(const isl::multi_val & upper)10189 isl::set basic_set::upper_bound(const isl::multi_val &upper) const
10190 {
10191   if (!ptr)
10192     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10193   return isl::set(*this).upper_bound(upper);
10194 }
10195 
10196 inline std::ostream &operator<<(std::ostream &os, const basic_set &obj)
10197 {
10198   if (!obj.get())
10199     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10200   auto saved_ctx = isl_basic_set_get_ctx(obj.get());
10201   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10202   char *str = isl_basic_set_to_str(obj.get());
10203   if (!str)
10204     exception::throw_last_error(saved_ctx);
10205   os << str;
10206   free(str);
10207   return os;
10208 }
10209 
10210 // implementations for isl::fixed_box
manage(__isl_take isl_fixed_box * ptr)10211 fixed_box manage(__isl_take isl_fixed_box *ptr) {
10212   if (!ptr)
10213     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10214   return fixed_box(ptr);
10215 }
manage_copy(__isl_keep isl_fixed_box * ptr)10216 fixed_box manage_copy(__isl_keep isl_fixed_box *ptr) {
10217   if (!ptr)
10218     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10219   auto saved_ctx = isl_fixed_box_get_ctx(ptr);
10220   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10221   ptr = isl_fixed_box_copy(ptr);
10222   if (!ptr)
10223     exception::throw_last_error(saved_ctx);
10224   return fixed_box(ptr);
10225 }
10226 
fixed_box()10227 fixed_box::fixed_box()
10228     : ptr(nullptr) {}
10229 
fixed_box(const fixed_box & obj)10230 fixed_box::fixed_box(const fixed_box &obj)
10231     : ptr(nullptr)
10232 {
10233   if (!obj.ptr)
10234     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10235   auto saved_ctx = isl_fixed_box_get_ctx(obj.ptr);
10236   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10237   ptr = obj.copy();
10238   if (!ptr)
10239     exception::throw_last_error(saved_ctx);
10240 }
10241 
fixed_box(__isl_take isl_fixed_box * ptr)10242 fixed_box::fixed_box(__isl_take isl_fixed_box *ptr)
10243     : ptr(ptr) {}
10244 
10245 fixed_box &fixed_box::operator=(fixed_box obj) {
10246   std::swap(this->ptr, obj.ptr);
10247   return *this;
10248 }
10249 
~fixed_box()10250 fixed_box::~fixed_box() {
10251   if (ptr)
10252     isl_fixed_box_free(ptr);
10253 }
10254 
copy()10255 __isl_give isl_fixed_box *fixed_box::copy() const & {
10256   return isl_fixed_box_copy(ptr);
10257 }
10258 
get()10259 __isl_keep isl_fixed_box *fixed_box::get() const {
10260   return ptr;
10261 }
10262 
release()10263 __isl_give isl_fixed_box *fixed_box::release() {
10264   isl_fixed_box *tmp = ptr;
10265   ptr = nullptr;
10266   return tmp;
10267 }
10268 
is_null()10269 bool fixed_box::is_null() const {
10270   return ptr == nullptr;
10271 }
10272 
ctx()10273 isl::ctx fixed_box::ctx() const {
10274   return isl::ctx(isl_fixed_box_get_ctx(ptr));
10275 }
10276 
is_valid()10277 bool fixed_box::is_valid() const
10278 {
10279   if (!ptr)
10280     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10281   auto saved_ctx = ctx();
10282   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10283   auto res = isl_fixed_box_is_valid(get());
10284   if (res < 0)
10285     exception::throw_last_error(saved_ctx);
10286   return res;
10287 }
10288 
offset()10289 isl::multi_aff fixed_box::offset() const
10290 {
10291   if (!ptr)
10292     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10293   auto saved_ctx = ctx();
10294   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10295   auto res = isl_fixed_box_get_offset(get());
10296   if (!res)
10297     exception::throw_last_error(saved_ctx);
10298   return manage(res);
10299 }
10300 
get_offset()10301 isl::multi_aff fixed_box::get_offset() const
10302 {
10303   return offset();
10304 }
10305 
size()10306 isl::multi_val fixed_box::size() const
10307 {
10308   if (!ptr)
10309     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10310   auto saved_ctx = ctx();
10311   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10312   auto res = isl_fixed_box_get_size(get());
10313   if (!res)
10314     exception::throw_last_error(saved_ctx);
10315   return manage(res);
10316 }
10317 
get_size()10318 isl::multi_val fixed_box::get_size() const
10319 {
10320   return size();
10321 }
10322 
space()10323 isl::space fixed_box::space() const
10324 {
10325   if (!ptr)
10326     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10327   auto saved_ctx = ctx();
10328   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10329   auto res = isl_fixed_box_get_space(get());
10330   if (!res)
10331     exception::throw_last_error(saved_ctx);
10332   return manage(res);
10333 }
10334 
get_space()10335 isl::space fixed_box::get_space() const
10336 {
10337   return space();
10338 }
10339 
10340 inline std::ostream &operator<<(std::ostream &os, const fixed_box &obj)
10341 {
10342   if (!obj.get())
10343     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10344   auto saved_ctx = isl_fixed_box_get_ctx(obj.get());
10345   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10346   char *str = isl_fixed_box_to_str(obj.get());
10347   if (!str)
10348     exception::throw_last_error(saved_ctx);
10349   os << str;
10350   free(str);
10351   return os;
10352 }
10353 
10354 // implementations for isl::id
manage(__isl_take isl_id * ptr)10355 id manage(__isl_take isl_id *ptr) {
10356   if (!ptr)
10357     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10358   return id(ptr);
10359 }
manage_copy(__isl_keep isl_id * ptr)10360 id manage_copy(__isl_keep isl_id *ptr) {
10361   if (!ptr)
10362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10363   auto saved_ctx = isl_id_get_ctx(ptr);
10364   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10365   ptr = isl_id_copy(ptr);
10366   if (!ptr)
10367     exception::throw_last_error(saved_ctx);
10368   return id(ptr);
10369 }
10370 
id()10371 id::id()
10372     : ptr(nullptr) {}
10373 
id(const id & obj)10374 id::id(const id &obj)
10375     : ptr(nullptr)
10376 {
10377   if (!obj.ptr)
10378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10379   auto saved_ctx = isl_id_get_ctx(obj.ptr);
10380   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10381   ptr = obj.copy();
10382   if (!ptr)
10383     exception::throw_last_error(saved_ctx);
10384 }
10385 
id(__isl_take isl_id * ptr)10386 id::id(__isl_take isl_id *ptr)
10387     : ptr(ptr) {}
10388 
id(isl::ctx ctx,const std::string & str)10389 id::id(isl::ctx ctx, const std::string &str)
10390 {
10391   auto saved_ctx = ctx;
10392   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10393   auto res = isl_id_read_from_str(ctx.release(), str.c_str());
10394   if (!res)
10395     exception::throw_last_error(saved_ctx);
10396   ptr = res;
10397 }
10398 
10399 id &id::operator=(id obj) {
10400   std::swap(this->ptr, obj.ptr);
10401   return *this;
10402 }
10403 
~id()10404 id::~id() {
10405   if (ptr)
10406     isl_id_free(ptr);
10407 }
10408 
copy()10409 __isl_give isl_id *id::copy() const & {
10410   return isl_id_copy(ptr);
10411 }
10412 
get()10413 __isl_keep isl_id *id::get() const {
10414   return ptr;
10415 }
10416 
release()10417 __isl_give isl_id *id::release() {
10418   isl_id *tmp = ptr;
10419   ptr = nullptr;
10420   return tmp;
10421 }
10422 
is_null()10423 bool id::is_null() const {
10424   return ptr == nullptr;
10425 }
10426 
ctx()10427 isl::ctx id::ctx() const {
10428   return isl::ctx(isl_id_get_ctx(ptr));
10429 }
10430 
name()10431 std::string id::name() const
10432 {
10433   if (!ptr)
10434     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10435   auto saved_ctx = ctx();
10436   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10437   auto res = isl_id_get_name(get());
10438   std::string tmp(res);
10439   return tmp;
10440 }
10441 
get_name()10442 std::string id::get_name() const
10443 {
10444   return name();
10445 }
10446 
to_list()10447 isl::id_list id::to_list() const
10448 {
10449   if (!ptr)
10450     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10451   auto saved_ctx = ctx();
10452   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10453   auto res = isl_id_to_list(copy());
10454   if (!res)
10455     exception::throw_last_error(saved_ctx);
10456   return manage(res);
10457 }
10458 
10459 inline std::ostream &operator<<(std::ostream &os, const id &obj)
10460 {
10461   if (!obj.get())
10462     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10463   auto saved_ctx = isl_id_get_ctx(obj.get());
10464   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10465   char *str = isl_id_to_str(obj.get());
10466   if (!str)
10467     exception::throw_last_error(saved_ctx);
10468   os << str;
10469   free(str);
10470   return os;
10471 }
10472 
10473 // implementations for isl::id_list
manage(__isl_take isl_id_list * ptr)10474 id_list manage(__isl_take isl_id_list *ptr) {
10475   if (!ptr)
10476     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10477   return id_list(ptr);
10478 }
manage_copy(__isl_keep isl_id_list * ptr)10479 id_list manage_copy(__isl_keep isl_id_list *ptr) {
10480   if (!ptr)
10481     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10482   auto saved_ctx = isl_id_list_get_ctx(ptr);
10483   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10484   ptr = isl_id_list_copy(ptr);
10485   if (!ptr)
10486     exception::throw_last_error(saved_ctx);
10487   return id_list(ptr);
10488 }
10489 
id_list()10490 id_list::id_list()
10491     : ptr(nullptr) {}
10492 
id_list(const id_list & obj)10493 id_list::id_list(const id_list &obj)
10494     : ptr(nullptr)
10495 {
10496   if (!obj.ptr)
10497     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10498   auto saved_ctx = isl_id_list_get_ctx(obj.ptr);
10499   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10500   ptr = obj.copy();
10501   if (!ptr)
10502     exception::throw_last_error(saved_ctx);
10503 }
10504 
id_list(__isl_take isl_id_list * ptr)10505 id_list::id_list(__isl_take isl_id_list *ptr)
10506     : ptr(ptr) {}
10507 
id_list(isl::ctx ctx,int n)10508 id_list::id_list(isl::ctx ctx, int n)
10509 {
10510   auto saved_ctx = ctx;
10511   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10512   auto res = isl_id_list_alloc(ctx.release(), n);
10513   if (!res)
10514     exception::throw_last_error(saved_ctx);
10515   ptr = res;
10516 }
10517 
id_list(isl::id el)10518 id_list::id_list(isl::id el)
10519 {
10520   if (el.is_null())
10521     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10522   auto saved_ctx = el.ctx();
10523   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10524   auto res = isl_id_list_from_id(el.release());
10525   if (!res)
10526     exception::throw_last_error(saved_ctx);
10527   ptr = res;
10528 }
10529 
id_list(isl::ctx ctx,const std::string & str)10530 id_list::id_list(isl::ctx ctx, const std::string &str)
10531 {
10532   auto saved_ctx = ctx;
10533   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10534   auto res = isl_id_list_read_from_str(ctx.release(), str.c_str());
10535   if (!res)
10536     exception::throw_last_error(saved_ctx);
10537   ptr = res;
10538 }
10539 
10540 id_list &id_list::operator=(id_list obj) {
10541   std::swap(this->ptr, obj.ptr);
10542   return *this;
10543 }
10544 
~id_list()10545 id_list::~id_list() {
10546   if (ptr)
10547     isl_id_list_free(ptr);
10548 }
10549 
copy()10550 __isl_give isl_id_list *id_list::copy() const & {
10551   return isl_id_list_copy(ptr);
10552 }
10553 
get()10554 __isl_keep isl_id_list *id_list::get() const {
10555   return ptr;
10556 }
10557 
release()10558 __isl_give isl_id_list *id_list::release() {
10559   isl_id_list *tmp = ptr;
10560   ptr = nullptr;
10561   return tmp;
10562 }
10563 
is_null()10564 bool id_list::is_null() const {
10565   return ptr == nullptr;
10566 }
10567 
ctx()10568 isl::ctx id_list::ctx() const {
10569   return isl::ctx(isl_id_list_get_ctx(ptr));
10570 }
10571 
add(isl::id el)10572 isl::id_list id_list::add(isl::id el) const
10573 {
10574   if (!ptr || el.is_null())
10575     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10576   auto saved_ctx = ctx();
10577   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10578   auto res = isl_id_list_add(copy(), el.release());
10579   if (!res)
10580     exception::throw_last_error(saved_ctx);
10581   return manage(res);
10582 }
10583 
add(const std::string & el)10584 isl::id_list id_list::add(const std::string &el) const
10585 {
10586   if (!ptr)
10587     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10588   return this->add(isl::id(ctx(), el));
10589 }
10590 
at(int index)10591 isl::id id_list::at(int index) const
10592 {
10593   if (!ptr)
10594     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10595   auto saved_ctx = ctx();
10596   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10597   auto res = isl_id_list_get_at(get(), index);
10598   if (!res)
10599     exception::throw_last_error(saved_ctx);
10600   return manage(res);
10601 }
10602 
get_at(int index)10603 isl::id id_list::get_at(int index) const
10604 {
10605   return at(index);
10606 }
10607 
clear()10608 isl::id_list id_list::clear() const
10609 {
10610   if (!ptr)
10611     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10612   auto saved_ctx = ctx();
10613   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10614   auto res = isl_id_list_clear(copy());
10615   if (!res)
10616     exception::throw_last_error(saved_ctx);
10617   return manage(res);
10618 }
10619 
concat(isl::id_list list2)10620 isl::id_list id_list::concat(isl::id_list list2) const
10621 {
10622   if (!ptr || list2.is_null())
10623     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10624   auto saved_ctx = ctx();
10625   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10626   auto res = isl_id_list_concat(copy(), list2.release());
10627   if (!res)
10628     exception::throw_last_error(saved_ctx);
10629   return manage(res);
10630 }
10631 
drop(unsigned int first,unsigned int n)10632 isl::id_list id_list::drop(unsigned int first, unsigned int n) const
10633 {
10634   if (!ptr)
10635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10636   auto saved_ctx = ctx();
10637   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10638   auto res = isl_id_list_drop(copy(), first, n);
10639   if (!res)
10640     exception::throw_last_error(saved_ctx);
10641   return manage(res);
10642 }
10643 
foreach(const std::function<void (isl::id)> & fn)10644 void id_list::foreach(const std::function<void(isl::id)> &fn) const
10645 {
10646   if (!ptr)
10647     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10648   auto saved_ctx = ctx();
10649   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10650   struct fn_data {
10651     std::function<void(isl::id)> func;
10652     std::exception_ptr eptr;
10653   } fn_data = { fn };
10654   auto fn_lambda = [](isl_id *arg_0, void *arg_1) -> isl_stat {
10655     auto *data = static_cast<struct fn_data *>(arg_1);
10656     ISL_CPP_TRY {
10657       (data->func)(manage(arg_0));
10658       return isl_stat_ok;
10659     } ISL_CPP_CATCH_ALL {
10660       data->eptr = std::current_exception();
10661       return isl_stat_error;
10662     }
10663   };
10664   auto res = isl_id_list_foreach(get(), fn_lambda, &fn_data);
10665   if (fn_data.eptr)
10666     std::rethrow_exception(fn_data.eptr);
10667   if (res < 0)
10668     exception::throw_last_error(saved_ctx);
10669   return;
10670 }
10671 
insert(unsigned int pos,isl::id el)10672 isl::id_list id_list::insert(unsigned int pos, isl::id el) const
10673 {
10674   if (!ptr || el.is_null())
10675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10676   auto saved_ctx = ctx();
10677   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10678   auto res = isl_id_list_insert(copy(), pos, el.release());
10679   if (!res)
10680     exception::throw_last_error(saved_ctx);
10681   return manage(res);
10682 }
10683 
insert(unsigned int pos,const std::string & el)10684 isl::id_list id_list::insert(unsigned int pos, const std::string &el) const
10685 {
10686   if (!ptr)
10687     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10688   return this->insert(pos, isl::id(ctx(), el));
10689 }
10690 
size()10691 unsigned id_list::size() const
10692 {
10693   if (!ptr)
10694     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10695   auto saved_ctx = ctx();
10696   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10697   auto res = isl_id_list_size(get());
10698   if (res < 0)
10699     exception::throw_last_error(saved_ctx);
10700   return res;
10701 }
10702 
10703 inline std::ostream &operator<<(std::ostream &os, const id_list &obj)
10704 {
10705   if (!obj.get())
10706     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10707   auto saved_ctx = isl_id_list_get_ctx(obj.get());
10708   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10709   char *str = isl_id_list_to_str(obj.get());
10710   if (!str)
10711     exception::throw_last_error(saved_ctx);
10712   os << str;
10713   free(str);
10714   return os;
10715 }
10716 
10717 // implementations for isl::map
manage(__isl_take isl_map * ptr)10718 map manage(__isl_take isl_map *ptr) {
10719   if (!ptr)
10720     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10721   return map(ptr);
10722 }
manage_copy(__isl_keep isl_map * ptr)10723 map manage_copy(__isl_keep isl_map *ptr) {
10724   if (!ptr)
10725     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10726   auto saved_ctx = isl_map_get_ctx(ptr);
10727   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10728   ptr = isl_map_copy(ptr);
10729   if (!ptr)
10730     exception::throw_last_error(saved_ctx);
10731   return map(ptr);
10732 }
10733 
map()10734 map::map()
10735     : ptr(nullptr) {}
10736 
map(const map & obj)10737 map::map(const map &obj)
10738     : ptr(nullptr)
10739 {
10740   if (!obj.ptr)
10741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10742   auto saved_ctx = isl_map_get_ctx(obj.ptr);
10743   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10744   ptr = obj.copy();
10745   if (!ptr)
10746     exception::throw_last_error(saved_ctx);
10747 }
10748 
map(__isl_take isl_map * ptr)10749 map::map(__isl_take isl_map *ptr)
10750     : ptr(ptr) {}
10751 
map(isl::basic_map bmap)10752 map::map(isl::basic_map bmap)
10753 {
10754   if (bmap.is_null())
10755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10756   auto saved_ctx = bmap.ctx();
10757   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10758   auto res = isl_map_from_basic_map(bmap.release());
10759   if (!res)
10760     exception::throw_last_error(saved_ctx);
10761   ptr = res;
10762 }
10763 
map(isl::ctx ctx,const std::string & str)10764 map::map(isl::ctx ctx, const std::string &str)
10765 {
10766   auto saved_ctx = ctx;
10767   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10768   auto res = isl_map_read_from_str(ctx.release(), str.c_str());
10769   if (!res)
10770     exception::throw_last_error(saved_ctx);
10771   ptr = res;
10772 }
10773 
10774 map &map::operator=(map obj) {
10775   std::swap(this->ptr, obj.ptr);
10776   return *this;
10777 }
10778 
~map()10779 map::~map() {
10780   if (ptr)
10781     isl_map_free(ptr);
10782 }
10783 
copy()10784 __isl_give isl_map *map::copy() const & {
10785   return isl_map_copy(ptr);
10786 }
10787 
get()10788 __isl_keep isl_map *map::get() const {
10789   return ptr;
10790 }
10791 
release()10792 __isl_give isl_map *map::release() {
10793   isl_map *tmp = ptr;
10794   ptr = nullptr;
10795   return tmp;
10796 }
10797 
is_null()10798 bool map::is_null() const {
10799   return ptr == nullptr;
10800 }
10801 
ctx()10802 isl::ctx map::ctx() const {
10803   return isl::ctx(isl_map_get_ctx(ptr));
10804 }
10805 
affine_hull()10806 isl::basic_map map::affine_hull() const
10807 {
10808   if (!ptr)
10809     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10810   auto saved_ctx = ctx();
10811   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10812   auto res = isl_map_affine_hull(copy());
10813   if (!res)
10814     exception::throw_last_error(saved_ctx);
10815   return manage(res);
10816 }
10817 
apply_domain(isl::map map2)10818 isl::map map::apply_domain(isl::map map2) const
10819 {
10820   if (!ptr || map2.is_null())
10821     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10822   auto saved_ctx = ctx();
10823   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10824   auto res = isl_map_apply_domain(copy(), map2.release());
10825   if (!res)
10826     exception::throw_last_error(saved_ctx);
10827   return manage(res);
10828 }
10829 
apply_domain(const isl::union_map & umap2)10830 isl::union_map map::apply_domain(const isl::union_map &umap2) const
10831 {
10832   if (!ptr)
10833     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10834   return isl::union_map(*this).apply_domain(umap2);
10835 }
10836 
apply_domain(const isl::basic_map & map2)10837 isl::map map::apply_domain(const isl::basic_map &map2) const
10838 {
10839   if (!ptr)
10840     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10841   return this->apply_domain(isl::map(map2));
10842 }
10843 
apply_range(isl::map map2)10844 isl::map map::apply_range(isl::map map2) const
10845 {
10846   if (!ptr || map2.is_null())
10847     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10848   auto saved_ctx = ctx();
10849   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10850   auto res = isl_map_apply_range(copy(), map2.release());
10851   if (!res)
10852     exception::throw_last_error(saved_ctx);
10853   return manage(res);
10854 }
10855 
apply_range(const isl::union_map & umap2)10856 isl::union_map map::apply_range(const isl::union_map &umap2) const
10857 {
10858   if (!ptr)
10859     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10860   return isl::union_map(*this).apply_range(umap2);
10861 }
10862 
apply_range(const isl::basic_map & map2)10863 isl::map map::apply_range(const isl::basic_map &map2) const
10864 {
10865   if (!ptr)
10866     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10867   return this->apply_range(isl::map(map2));
10868 }
10869 
as_map()10870 isl::map map::as_map() const
10871 {
10872   if (!ptr)
10873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10874   return isl::union_map(*this).as_map();
10875 }
10876 
as_multi_union_pw_aff()10877 isl::multi_union_pw_aff map::as_multi_union_pw_aff() const
10878 {
10879   if (!ptr)
10880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10881   return isl::union_map(*this).as_multi_union_pw_aff();
10882 }
10883 
as_pw_multi_aff()10884 isl::pw_multi_aff map::as_pw_multi_aff() const
10885 {
10886   if (!ptr)
10887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10888   auto saved_ctx = ctx();
10889   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10890   auto res = isl_map_as_pw_multi_aff(copy());
10891   if (!res)
10892     exception::throw_last_error(saved_ctx);
10893   return manage(res);
10894 }
10895 
as_union_pw_multi_aff()10896 isl::union_pw_multi_aff map::as_union_pw_multi_aff() const
10897 {
10898   if (!ptr)
10899     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10900   return isl::union_map(*this).as_union_pw_multi_aff();
10901 }
10902 
bind_domain(isl::multi_id tuple)10903 isl::set map::bind_domain(isl::multi_id tuple) const
10904 {
10905   if (!ptr || tuple.is_null())
10906     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10907   auto saved_ctx = ctx();
10908   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10909   auto res = isl_map_bind_domain(copy(), tuple.release());
10910   if (!res)
10911     exception::throw_last_error(saved_ctx);
10912   return manage(res);
10913 }
10914 
bind_range(isl::multi_id tuple)10915 isl::set map::bind_range(isl::multi_id tuple) const
10916 {
10917   if (!ptr || tuple.is_null())
10918     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10919   auto saved_ctx = ctx();
10920   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10921   auto res = isl_map_bind_range(copy(), tuple.release());
10922   if (!res)
10923     exception::throw_last_error(saved_ctx);
10924   return manage(res);
10925 }
10926 
coalesce()10927 isl::map map::coalesce() const
10928 {
10929   if (!ptr)
10930     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10931   auto saved_ctx = ctx();
10932   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10933   auto res = isl_map_coalesce(copy());
10934   if (!res)
10935     exception::throw_last_error(saved_ctx);
10936   return manage(res);
10937 }
10938 
complement()10939 isl::map map::complement() const
10940 {
10941   if (!ptr)
10942     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10943   auto saved_ctx = ctx();
10944   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10945   auto res = isl_map_complement(copy());
10946   if (!res)
10947     exception::throw_last_error(saved_ctx);
10948   return manage(res);
10949 }
10950 
compute_divs()10951 isl::union_map map::compute_divs() const
10952 {
10953   if (!ptr)
10954     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10955   return isl::union_map(*this).compute_divs();
10956 }
10957 
curry()10958 isl::map map::curry() const
10959 {
10960   if (!ptr)
10961     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10962   auto saved_ctx = ctx();
10963   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10964   auto res = isl_map_curry(copy());
10965   if (!res)
10966     exception::throw_last_error(saved_ctx);
10967   return manage(res);
10968 }
10969 
deltas()10970 isl::set map::deltas() const
10971 {
10972   if (!ptr)
10973     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10974   auto saved_ctx = ctx();
10975   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10976   auto res = isl_map_deltas(copy());
10977   if (!res)
10978     exception::throw_last_error(saved_ctx);
10979   return manage(res);
10980 }
10981 
detect_equalities()10982 isl::map map::detect_equalities() const
10983 {
10984   if (!ptr)
10985     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10986   auto saved_ctx = ctx();
10987   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10988   auto res = isl_map_detect_equalities(copy());
10989   if (!res)
10990     exception::throw_last_error(saved_ctx);
10991   return manage(res);
10992 }
10993 
domain()10994 isl::set map::domain() const
10995 {
10996   if (!ptr)
10997     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10998   auto saved_ctx = ctx();
10999   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11000   auto res = isl_map_domain(copy());
11001   if (!res)
11002     exception::throw_last_error(saved_ctx);
11003   return manage(res);
11004 }
11005 
domain_factor_domain()11006 isl::map map::domain_factor_domain() const
11007 {
11008   if (!ptr)
11009     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11010   auto saved_ctx = ctx();
11011   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11012   auto res = isl_map_domain_factor_domain(copy());
11013   if (!res)
11014     exception::throw_last_error(saved_ctx);
11015   return manage(res);
11016 }
11017 
domain_factor_range()11018 isl::map map::domain_factor_range() const
11019 {
11020   if (!ptr)
11021     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11022   auto saved_ctx = ctx();
11023   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11024   auto res = isl_map_domain_factor_range(copy());
11025   if (!res)
11026     exception::throw_last_error(saved_ctx);
11027   return manage(res);
11028 }
11029 
domain_map()11030 isl::union_map map::domain_map() const
11031 {
11032   if (!ptr)
11033     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11034   return isl::union_map(*this).domain_map();
11035 }
11036 
domain_map_union_pw_multi_aff()11037 isl::union_pw_multi_aff map::domain_map_union_pw_multi_aff() const
11038 {
11039   if (!ptr)
11040     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11041   return isl::union_map(*this).domain_map_union_pw_multi_aff();
11042 }
11043 
domain_product(isl::map map2)11044 isl::map map::domain_product(isl::map map2) const
11045 {
11046   if (!ptr || map2.is_null())
11047     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11048   auto saved_ctx = ctx();
11049   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11050   auto res = isl_map_domain_product(copy(), map2.release());
11051   if (!res)
11052     exception::throw_last_error(saved_ctx);
11053   return manage(res);
11054 }
11055 
domain_product(const isl::union_map & umap2)11056 isl::union_map map::domain_product(const isl::union_map &umap2) const
11057 {
11058   if (!ptr)
11059     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11060   return isl::union_map(*this).domain_product(umap2);
11061 }
11062 
domain_product(const isl::basic_map & map2)11063 isl::map map::domain_product(const isl::basic_map &map2) const
11064 {
11065   if (!ptr)
11066     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11067   return this->domain_product(isl::map(map2));
11068 }
11069 
domain_tuple_dim()11070 unsigned map::domain_tuple_dim() const
11071 {
11072   if (!ptr)
11073     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11074   auto saved_ctx = ctx();
11075   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11076   auto res = isl_map_domain_tuple_dim(get());
11077   if (res < 0)
11078     exception::throw_last_error(saved_ctx);
11079   return res;
11080 }
11081 
domain_tuple_id()11082 isl::id map::domain_tuple_id() const
11083 {
11084   if (!ptr)
11085     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11086   auto saved_ctx = ctx();
11087   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11088   auto res = isl_map_get_domain_tuple_id(get());
11089   if (!res)
11090     exception::throw_last_error(saved_ctx);
11091   return manage(res);
11092 }
11093 
get_domain_tuple_id()11094 isl::id map::get_domain_tuple_id() const
11095 {
11096   return domain_tuple_id();
11097 }
11098 
empty(isl::space space)11099 isl::map map::empty(isl::space space)
11100 {
11101   if (space.is_null())
11102     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11103   auto saved_ctx = space.ctx();
11104   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11105   auto res = isl_map_empty(space.release());
11106   if (!res)
11107     exception::throw_last_error(saved_ctx);
11108   return manage(res);
11109 }
11110 
eq_at(isl::multi_pw_aff mpa)11111 isl::map map::eq_at(isl::multi_pw_aff mpa) const
11112 {
11113   if (!ptr || mpa.is_null())
11114     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11115   auto saved_ctx = ctx();
11116   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11117   auto res = isl_map_eq_at_multi_pw_aff(copy(), mpa.release());
11118   if (!res)
11119     exception::throw_last_error(saved_ctx);
11120   return manage(res);
11121 }
11122 
eq_at(const isl::multi_union_pw_aff & mupa)11123 isl::union_map map::eq_at(const isl::multi_union_pw_aff &mupa) const
11124 {
11125   if (!ptr)
11126     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11127   return isl::union_map(*this).eq_at(mupa);
11128 }
11129 
eq_at(const isl::aff & mpa)11130 isl::map map::eq_at(const isl::aff &mpa) const
11131 {
11132   if (!ptr)
11133     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11134   return this->eq_at(isl::multi_pw_aff(mpa));
11135 }
11136 
eq_at(const isl::multi_aff & mpa)11137 isl::map map::eq_at(const isl::multi_aff &mpa) const
11138 {
11139   if (!ptr)
11140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11141   return this->eq_at(isl::multi_pw_aff(mpa));
11142 }
11143 
eq_at(const isl::pw_aff & mpa)11144 isl::map map::eq_at(const isl::pw_aff &mpa) const
11145 {
11146   if (!ptr)
11147     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11148   return this->eq_at(isl::multi_pw_aff(mpa));
11149 }
11150 
eq_at(const isl::pw_multi_aff & mpa)11151 isl::map map::eq_at(const isl::pw_multi_aff &mpa) const
11152 {
11153   if (!ptr)
11154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11155   return this->eq_at(isl::multi_pw_aff(mpa));
11156 }
11157 
every_map(const std::function<bool (isl::map)> & test)11158 bool map::every_map(const std::function<bool(isl::map)> &test) const
11159 {
11160   if (!ptr)
11161     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11162   return isl::union_map(*this).every_map(test);
11163 }
11164 
extract_map(const isl::space & space)11165 isl::map map::extract_map(const isl::space &space) const
11166 {
11167   if (!ptr)
11168     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11169   return isl::union_map(*this).extract_map(space);
11170 }
11171 
factor_domain()11172 isl::map map::factor_domain() const
11173 {
11174   if (!ptr)
11175     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11176   auto saved_ctx = ctx();
11177   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11178   auto res = isl_map_factor_domain(copy());
11179   if (!res)
11180     exception::throw_last_error(saved_ctx);
11181   return manage(res);
11182 }
11183 
factor_range()11184 isl::map map::factor_range() const
11185 {
11186   if (!ptr)
11187     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11188   auto saved_ctx = ctx();
11189   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11190   auto res = isl_map_factor_range(copy());
11191   if (!res)
11192     exception::throw_last_error(saved_ctx);
11193   return manage(res);
11194 }
11195 
fixed_power(const isl::val & exp)11196 isl::union_map map::fixed_power(const isl::val &exp) const
11197 {
11198   if (!ptr)
11199     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11200   return isl::union_map(*this).fixed_power(exp);
11201 }
11202 
fixed_power(long exp)11203 isl::union_map map::fixed_power(long exp) const
11204 {
11205   if (!ptr)
11206     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11207   return this->fixed_power(isl::val(ctx(), exp));
11208 }
11209 
flatten()11210 isl::map map::flatten() const
11211 {
11212   if (!ptr)
11213     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11214   auto saved_ctx = ctx();
11215   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11216   auto res = isl_map_flatten(copy());
11217   if (!res)
11218     exception::throw_last_error(saved_ctx);
11219   return manage(res);
11220 }
11221 
flatten_domain()11222 isl::map map::flatten_domain() const
11223 {
11224   if (!ptr)
11225     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11226   auto saved_ctx = ctx();
11227   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11228   auto res = isl_map_flatten_domain(copy());
11229   if (!res)
11230     exception::throw_last_error(saved_ctx);
11231   return manage(res);
11232 }
11233 
flatten_range()11234 isl::map map::flatten_range() const
11235 {
11236   if (!ptr)
11237     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11238   auto saved_ctx = ctx();
11239   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11240   auto res = isl_map_flatten_range(copy());
11241   if (!res)
11242     exception::throw_last_error(saved_ctx);
11243   return manage(res);
11244 }
11245 
foreach_basic_map(const std::function<void (isl::basic_map)> & fn)11246 void map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
11247 {
11248   if (!ptr)
11249     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11250   auto saved_ctx = ctx();
11251   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11252   struct fn_data {
11253     std::function<void(isl::basic_map)> func;
11254     std::exception_ptr eptr;
11255   } fn_data = { fn };
11256   auto fn_lambda = [](isl_basic_map *arg_0, void *arg_1) -> isl_stat {
11257     auto *data = static_cast<struct fn_data *>(arg_1);
11258     ISL_CPP_TRY {
11259       (data->func)(manage(arg_0));
11260       return isl_stat_ok;
11261     } ISL_CPP_CATCH_ALL {
11262       data->eptr = std::current_exception();
11263       return isl_stat_error;
11264     }
11265   };
11266   auto res = isl_map_foreach_basic_map(get(), fn_lambda, &fn_data);
11267   if (fn_data.eptr)
11268     std::rethrow_exception(fn_data.eptr);
11269   if (res < 0)
11270     exception::throw_last_error(saved_ctx);
11271   return;
11272 }
11273 
foreach_map(const std::function<void (isl::map)> & fn)11274 void map::foreach_map(const std::function<void(isl::map)> &fn) const
11275 {
11276   if (!ptr)
11277     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11278   return isl::union_map(*this).foreach_map(fn);
11279 }
11280 
gist(isl::map context)11281 isl::map map::gist(isl::map context) const
11282 {
11283   if (!ptr || context.is_null())
11284     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11285   auto saved_ctx = ctx();
11286   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11287   auto res = isl_map_gist(copy(), context.release());
11288   if (!res)
11289     exception::throw_last_error(saved_ctx);
11290   return manage(res);
11291 }
11292 
gist(const isl::union_map & context)11293 isl::union_map map::gist(const isl::union_map &context) const
11294 {
11295   if (!ptr)
11296     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11297   return isl::union_map(*this).gist(context);
11298 }
11299 
gist(const isl::basic_map & context)11300 isl::map map::gist(const isl::basic_map &context) const
11301 {
11302   if (!ptr)
11303     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11304   return this->gist(isl::map(context));
11305 }
11306 
gist_domain(isl::set context)11307 isl::map map::gist_domain(isl::set context) const
11308 {
11309   if (!ptr || context.is_null())
11310     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11311   auto saved_ctx = ctx();
11312   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11313   auto res = isl_map_gist_domain(copy(), context.release());
11314   if (!res)
11315     exception::throw_last_error(saved_ctx);
11316   return manage(res);
11317 }
11318 
gist_domain(const isl::union_set & uset)11319 isl::union_map map::gist_domain(const isl::union_set &uset) const
11320 {
11321   if (!ptr)
11322     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11323   return isl::union_map(*this).gist_domain(uset);
11324 }
11325 
gist_domain(const isl::basic_set & context)11326 isl::map map::gist_domain(const isl::basic_set &context) const
11327 {
11328   if (!ptr)
11329     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11330   return this->gist_domain(isl::set(context));
11331 }
11332 
gist_domain(const isl::point & context)11333 isl::map map::gist_domain(const isl::point &context) const
11334 {
11335   if (!ptr)
11336     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11337   return this->gist_domain(isl::set(context));
11338 }
11339 
gist_params(const isl::set & set)11340 isl::union_map map::gist_params(const isl::set &set) const
11341 {
11342   if (!ptr)
11343     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11344   return isl::union_map(*this).gist_params(set);
11345 }
11346 
gist_range(const isl::union_set & uset)11347 isl::union_map map::gist_range(const isl::union_set &uset) const
11348 {
11349   if (!ptr)
11350     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11351   return isl::union_map(*this).gist_range(uset);
11352 }
11353 
has_domain_tuple_id()11354 bool map::has_domain_tuple_id() const
11355 {
11356   if (!ptr)
11357     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11358   auto saved_ctx = ctx();
11359   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11360   auto res = isl_map_has_domain_tuple_id(get());
11361   if (res < 0)
11362     exception::throw_last_error(saved_ctx);
11363   return res;
11364 }
11365 
has_range_tuple_id()11366 bool map::has_range_tuple_id() const
11367 {
11368   if (!ptr)
11369     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11370   auto saved_ctx = ctx();
11371   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11372   auto res = isl_map_has_range_tuple_id(get());
11373   if (res < 0)
11374     exception::throw_last_error(saved_ctx);
11375   return res;
11376 }
11377 
intersect(isl::map map2)11378 isl::map map::intersect(isl::map map2) const
11379 {
11380   if (!ptr || map2.is_null())
11381     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11382   auto saved_ctx = ctx();
11383   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11384   auto res = isl_map_intersect(copy(), map2.release());
11385   if (!res)
11386     exception::throw_last_error(saved_ctx);
11387   return manage(res);
11388 }
11389 
intersect(const isl::union_map & umap2)11390 isl::union_map map::intersect(const isl::union_map &umap2) const
11391 {
11392   if (!ptr)
11393     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11394   return isl::union_map(*this).intersect(umap2);
11395 }
11396 
intersect(const isl::basic_map & map2)11397 isl::map map::intersect(const isl::basic_map &map2) const
11398 {
11399   if (!ptr)
11400     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11401   return this->intersect(isl::map(map2));
11402 }
11403 
intersect_domain(isl::set set)11404 isl::map map::intersect_domain(isl::set set) const
11405 {
11406   if (!ptr || set.is_null())
11407     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11408   auto saved_ctx = ctx();
11409   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11410   auto res = isl_map_intersect_domain(copy(), set.release());
11411   if (!res)
11412     exception::throw_last_error(saved_ctx);
11413   return manage(res);
11414 }
11415 
intersect_domain(const isl::space & space)11416 isl::union_map map::intersect_domain(const isl::space &space) const
11417 {
11418   if (!ptr)
11419     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11420   return isl::union_map(*this).intersect_domain(space);
11421 }
11422 
intersect_domain(const isl::union_set & uset)11423 isl::union_map map::intersect_domain(const isl::union_set &uset) const
11424 {
11425   if (!ptr)
11426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11427   return isl::union_map(*this).intersect_domain(uset);
11428 }
11429 
intersect_domain(const isl::basic_set & set)11430 isl::map map::intersect_domain(const isl::basic_set &set) const
11431 {
11432   if (!ptr)
11433     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11434   return this->intersect_domain(isl::set(set));
11435 }
11436 
intersect_domain(const isl::point & set)11437 isl::map map::intersect_domain(const isl::point &set) const
11438 {
11439   if (!ptr)
11440     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11441   return this->intersect_domain(isl::set(set));
11442 }
11443 
intersect_domain_factor_domain(isl::map factor)11444 isl::map map::intersect_domain_factor_domain(isl::map factor) const
11445 {
11446   if (!ptr || factor.is_null())
11447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11448   auto saved_ctx = ctx();
11449   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11450   auto res = isl_map_intersect_domain_factor_domain(copy(), factor.release());
11451   if (!res)
11452     exception::throw_last_error(saved_ctx);
11453   return manage(res);
11454 }
11455 
intersect_domain_factor_domain(const isl::union_map & factor)11456 isl::union_map map::intersect_domain_factor_domain(const isl::union_map &factor) const
11457 {
11458   if (!ptr)
11459     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11460   return isl::union_map(*this).intersect_domain_factor_domain(factor);
11461 }
11462 
intersect_domain_factor_domain(const isl::basic_map & factor)11463 isl::map map::intersect_domain_factor_domain(const isl::basic_map &factor) const
11464 {
11465   if (!ptr)
11466     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11467   return this->intersect_domain_factor_domain(isl::map(factor));
11468 }
11469 
intersect_domain_factor_range(isl::map factor)11470 isl::map map::intersect_domain_factor_range(isl::map factor) const
11471 {
11472   if (!ptr || factor.is_null())
11473     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11474   auto saved_ctx = ctx();
11475   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11476   auto res = isl_map_intersect_domain_factor_range(copy(), factor.release());
11477   if (!res)
11478     exception::throw_last_error(saved_ctx);
11479   return manage(res);
11480 }
11481 
intersect_domain_factor_range(const isl::union_map & factor)11482 isl::union_map map::intersect_domain_factor_range(const isl::union_map &factor) const
11483 {
11484   if (!ptr)
11485     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11486   return isl::union_map(*this).intersect_domain_factor_range(factor);
11487 }
11488 
intersect_domain_factor_range(const isl::basic_map & factor)11489 isl::map map::intersect_domain_factor_range(const isl::basic_map &factor) const
11490 {
11491   if (!ptr)
11492     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11493   return this->intersect_domain_factor_range(isl::map(factor));
11494 }
11495 
intersect_params(isl::set params)11496 isl::map map::intersect_params(isl::set params) const
11497 {
11498   if (!ptr || params.is_null())
11499     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11500   auto saved_ctx = ctx();
11501   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11502   auto res = isl_map_intersect_params(copy(), params.release());
11503   if (!res)
11504     exception::throw_last_error(saved_ctx);
11505   return manage(res);
11506 }
11507 
intersect_range(isl::set set)11508 isl::map map::intersect_range(isl::set set) const
11509 {
11510   if (!ptr || set.is_null())
11511     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11512   auto saved_ctx = ctx();
11513   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11514   auto res = isl_map_intersect_range(copy(), set.release());
11515   if (!res)
11516     exception::throw_last_error(saved_ctx);
11517   return manage(res);
11518 }
11519 
intersect_range(const isl::space & space)11520 isl::union_map map::intersect_range(const isl::space &space) const
11521 {
11522   if (!ptr)
11523     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11524   return isl::union_map(*this).intersect_range(space);
11525 }
11526 
intersect_range(const isl::union_set & uset)11527 isl::union_map map::intersect_range(const isl::union_set &uset) const
11528 {
11529   if (!ptr)
11530     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11531   return isl::union_map(*this).intersect_range(uset);
11532 }
11533 
intersect_range(const isl::basic_set & set)11534 isl::map map::intersect_range(const isl::basic_set &set) const
11535 {
11536   if (!ptr)
11537     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11538   return this->intersect_range(isl::set(set));
11539 }
11540 
intersect_range(const isl::point & set)11541 isl::map map::intersect_range(const isl::point &set) const
11542 {
11543   if (!ptr)
11544     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11545   return this->intersect_range(isl::set(set));
11546 }
11547 
intersect_range_factor_domain(isl::map factor)11548 isl::map map::intersect_range_factor_domain(isl::map factor) const
11549 {
11550   if (!ptr || factor.is_null())
11551     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11552   auto saved_ctx = ctx();
11553   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11554   auto res = isl_map_intersect_range_factor_domain(copy(), factor.release());
11555   if (!res)
11556     exception::throw_last_error(saved_ctx);
11557   return manage(res);
11558 }
11559 
intersect_range_factor_domain(const isl::union_map & factor)11560 isl::union_map map::intersect_range_factor_domain(const isl::union_map &factor) const
11561 {
11562   if (!ptr)
11563     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11564   return isl::union_map(*this).intersect_range_factor_domain(factor);
11565 }
11566 
intersect_range_factor_domain(const isl::basic_map & factor)11567 isl::map map::intersect_range_factor_domain(const isl::basic_map &factor) const
11568 {
11569   if (!ptr)
11570     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11571   return this->intersect_range_factor_domain(isl::map(factor));
11572 }
11573 
intersect_range_factor_range(isl::map factor)11574 isl::map map::intersect_range_factor_range(isl::map factor) const
11575 {
11576   if (!ptr || factor.is_null())
11577     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11578   auto saved_ctx = ctx();
11579   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11580   auto res = isl_map_intersect_range_factor_range(copy(), factor.release());
11581   if (!res)
11582     exception::throw_last_error(saved_ctx);
11583   return manage(res);
11584 }
11585 
intersect_range_factor_range(const isl::union_map & factor)11586 isl::union_map map::intersect_range_factor_range(const isl::union_map &factor) const
11587 {
11588   if (!ptr)
11589     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11590   return isl::union_map(*this).intersect_range_factor_range(factor);
11591 }
11592 
intersect_range_factor_range(const isl::basic_map & factor)11593 isl::map map::intersect_range_factor_range(const isl::basic_map &factor) const
11594 {
11595   if (!ptr)
11596     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11597   return this->intersect_range_factor_range(isl::map(factor));
11598 }
11599 
is_bijective()11600 bool map::is_bijective() const
11601 {
11602   if (!ptr)
11603     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11604   auto saved_ctx = ctx();
11605   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11606   auto res = isl_map_is_bijective(get());
11607   if (res < 0)
11608     exception::throw_last_error(saved_ctx);
11609   return res;
11610 }
11611 
is_disjoint(const isl::map & map2)11612 bool map::is_disjoint(const isl::map &map2) const
11613 {
11614   if (!ptr || map2.is_null())
11615     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11616   auto saved_ctx = ctx();
11617   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11618   auto res = isl_map_is_disjoint(get(), map2.get());
11619   if (res < 0)
11620     exception::throw_last_error(saved_ctx);
11621   return res;
11622 }
11623 
is_disjoint(const isl::union_map & umap2)11624 bool map::is_disjoint(const isl::union_map &umap2) const
11625 {
11626   if (!ptr)
11627     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11628   return isl::union_map(*this).is_disjoint(umap2);
11629 }
11630 
is_disjoint(const isl::basic_map & map2)11631 bool map::is_disjoint(const isl::basic_map &map2) const
11632 {
11633   if (!ptr)
11634     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11635   return this->is_disjoint(isl::map(map2));
11636 }
11637 
is_empty()11638 bool map::is_empty() const
11639 {
11640   if (!ptr)
11641     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11642   auto saved_ctx = ctx();
11643   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11644   auto res = isl_map_is_empty(get());
11645   if (res < 0)
11646     exception::throw_last_error(saved_ctx);
11647   return res;
11648 }
11649 
is_equal(const isl::map & map2)11650 bool map::is_equal(const isl::map &map2) const
11651 {
11652   if (!ptr || map2.is_null())
11653     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11654   auto saved_ctx = ctx();
11655   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11656   auto res = isl_map_is_equal(get(), map2.get());
11657   if (res < 0)
11658     exception::throw_last_error(saved_ctx);
11659   return res;
11660 }
11661 
is_equal(const isl::union_map & umap2)11662 bool map::is_equal(const isl::union_map &umap2) const
11663 {
11664   if (!ptr)
11665     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11666   return isl::union_map(*this).is_equal(umap2);
11667 }
11668 
is_equal(const isl::basic_map & map2)11669 bool map::is_equal(const isl::basic_map &map2) const
11670 {
11671   if (!ptr)
11672     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11673   return this->is_equal(isl::map(map2));
11674 }
11675 
is_injective()11676 bool map::is_injective() const
11677 {
11678   if (!ptr)
11679     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11680   auto saved_ctx = ctx();
11681   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11682   auto res = isl_map_is_injective(get());
11683   if (res < 0)
11684     exception::throw_last_error(saved_ctx);
11685   return res;
11686 }
11687 
is_single_valued()11688 bool map::is_single_valued() const
11689 {
11690   if (!ptr)
11691     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11692   auto saved_ctx = ctx();
11693   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11694   auto res = isl_map_is_single_valued(get());
11695   if (res < 0)
11696     exception::throw_last_error(saved_ctx);
11697   return res;
11698 }
11699 
is_strict_subset(const isl::map & map2)11700 bool map::is_strict_subset(const isl::map &map2) const
11701 {
11702   if (!ptr || map2.is_null())
11703     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11704   auto saved_ctx = ctx();
11705   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11706   auto res = isl_map_is_strict_subset(get(), map2.get());
11707   if (res < 0)
11708     exception::throw_last_error(saved_ctx);
11709   return res;
11710 }
11711 
is_strict_subset(const isl::union_map & umap2)11712 bool map::is_strict_subset(const isl::union_map &umap2) const
11713 {
11714   if (!ptr)
11715     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11716   return isl::union_map(*this).is_strict_subset(umap2);
11717 }
11718 
is_strict_subset(const isl::basic_map & map2)11719 bool map::is_strict_subset(const isl::basic_map &map2) const
11720 {
11721   if (!ptr)
11722     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11723   return this->is_strict_subset(isl::map(map2));
11724 }
11725 
is_subset(const isl::map & map2)11726 bool map::is_subset(const isl::map &map2) const
11727 {
11728   if (!ptr || map2.is_null())
11729     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11730   auto saved_ctx = ctx();
11731   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11732   auto res = isl_map_is_subset(get(), map2.get());
11733   if (res < 0)
11734     exception::throw_last_error(saved_ctx);
11735   return res;
11736 }
11737 
is_subset(const isl::union_map & umap2)11738 bool map::is_subset(const isl::union_map &umap2) const
11739 {
11740   if (!ptr)
11741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11742   return isl::union_map(*this).is_subset(umap2);
11743 }
11744 
is_subset(const isl::basic_map & map2)11745 bool map::is_subset(const isl::basic_map &map2) const
11746 {
11747   if (!ptr)
11748     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11749   return this->is_subset(isl::map(map2));
11750 }
11751 
isa_map()11752 bool map::isa_map() const
11753 {
11754   if (!ptr)
11755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11756   return isl::union_map(*this).isa_map();
11757 }
11758 
lex_ge_at(isl::multi_pw_aff mpa)11759 isl::map map::lex_ge_at(isl::multi_pw_aff mpa) const
11760 {
11761   if (!ptr || mpa.is_null())
11762     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11763   auto saved_ctx = ctx();
11764   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11765   auto res = isl_map_lex_ge_at_multi_pw_aff(copy(), mpa.release());
11766   if (!res)
11767     exception::throw_last_error(saved_ctx);
11768   return manage(res);
11769 }
11770 
lex_gt_at(isl::multi_pw_aff mpa)11771 isl::map map::lex_gt_at(isl::multi_pw_aff mpa) const
11772 {
11773   if (!ptr || mpa.is_null())
11774     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11775   auto saved_ctx = ctx();
11776   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11777   auto res = isl_map_lex_gt_at_multi_pw_aff(copy(), mpa.release());
11778   if (!res)
11779     exception::throw_last_error(saved_ctx);
11780   return manage(res);
11781 }
11782 
lex_le_at(isl::multi_pw_aff mpa)11783 isl::map map::lex_le_at(isl::multi_pw_aff mpa) const
11784 {
11785   if (!ptr || mpa.is_null())
11786     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11787   auto saved_ctx = ctx();
11788   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11789   auto res = isl_map_lex_le_at_multi_pw_aff(copy(), mpa.release());
11790   if (!res)
11791     exception::throw_last_error(saved_ctx);
11792   return manage(res);
11793 }
11794 
lex_lt_at(isl::multi_pw_aff mpa)11795 isl::map map::lex_lt_at(isl::multi_pw_aff mpa) const
11796 {
11797   if (!ptr || mpa.is_null())
11798     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11799   auto saved_ctx = ctx();
11800   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11801   auto res = isl_map_lex_lt_at_multi_pw_aff(copy(), mpa.release());
11802   if (!res)
11803     exception::throw_last_error(saved_ctx);
11804   return manage(res);
11805 }
11806 
lexmax()11807 isl::map map::lexmax() const
11808 {
11809   if (!ptr)
11810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11811   auto saved_ctx = ctx();
11812   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11813   auto res = isl_map_lexmax(copy());
11814   if (!res)
11815     exception::throw_last_error(saved_ctx);
11816   return manage(res);
11817 }
11818 
lexmax_pw_multi_aff()11819 isl::pw_multi_aff map::lexmax_pw_multi_aff() const
11820 {
11821   if (!ptr)
11822     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11823   auto saved_ctx = ctx();
11824   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11825   auto res = isl_map_lexmax_pw_multi_aff(copy());
11826   if (!res)
11827     exception::throw_last_error(saved_ctx);
11828   return manage(res);
11829 }
11830 
lexmin()11831 isl::map map::lexmin() const
11832 {
11833   if (!ptr)
11834     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11835   auto saved_ctx = ctx();
11836   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11837   auto res = isl_map_lexmin(copy());
11838   if (!res)
11839     exception::throw_last_error(saved_ctx);
11840   return manage(res);
11841 }
11842 
lexmin_pw_multi_aff()11843 isl::pw_multi_aff map::lexmin_pw_multi_aff() const
11844 {
11845   if (!ptr)
11846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11847   auto saved_ctx = ctx();
11848   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11849   auto res = isl_map_lexmin_pw_multi_aff(copy());
11850   if (!res)
11851     exception::throw_last_error(saved_ctx);
11852   return manage(res);
11853 }
11854 
lower_bound(isl::multi_pw_aff lower)11855 isl::map map::lower_bound(isl::multi_pw_aff lower) const
11856 {
11857   if (!ptr || lower.is_null())
11858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11859   auto saved_ctx = ctx();
11860   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11861   auto res = isl_map_lower_bound_multi_pw_aff(copy(), lower.release());
11862   if (!res)
11863     exception::throw_last_error(saved_ctx);
11864   return manage(res);
11865 }
11866 
map_list()11867 isl::map_list map::map_list() const
11868 {
11869   if (!ptr)
11870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11871   return isl::union_map(*this).map_list();
11872 }
11873 
max_multi_pw_aff()11874 isl::multi_pw_aff map::max_multi_pw_aff() const
11875 {
11876   if (!ptr)
11877     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11878   auto saved_ctx = ctx();
11879   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11880   auto res = isl_map_max_multi_pw_aff(copy());
11881   if (!res)
11882     exception::throw_last_error(saved_ctx);
11883   return manage(res);
11884 }
11885 
min_multi_pw_aff()11886 isl::multi_pw_aff map::min_multi_pw_aff() const
11887 {
11888   if (!ptr)
11889     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11890   auto saved_ctx = ctx();
11891   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11892   auto res = isl_map_min_multi_pw_aff(copy());
11893   if (!res)
11894     exception::throw_last_error(saved_ctx);
11895   return manage(res);
11896 }
11897 
n_basic_map()11898 unsigned map::n_basic_map() const
11899 {
11900   if (!ptr)
11901     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11902   auto saved_ctx = ctx();
11903   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11904   auto res = isl_map_n_basic_map(get());
11905   if (res < 0)
11906     exception::throw_last_error(saved_ctx);
11907   return res;
11908 }
11909 
polyhedral_hull()11910 isl::basic_map map::polyhedral_hull() const
11911 {
11912   if (!ptr)
11913     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11914   auto saved_ctx = ctx();
11915   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11916   auto res = isl_map_polyhedral_hull(copy());
11917   if (!res)
11918     exception::throw_last_error(saved_ctx);
11919   return manage(res);
11920 }
11921 
preimage_domain(isl::multi_aff ma)11922 isl::map map::preimage_domain(isl::multi_aff ma) const
11923 {
11924   if (!ptr || ma.is_null())
11925     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11926   auto saved_ctx = ctx();
11927   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11928   auto res = isl_map_preimage_domain_multi_aff(copy(), ma.release());
11929   if (!res)
11930     exception::throw_last_error(saved_ctx);
11931   return manage(res);
11932 }
11933 
preimage_domain(isl::multi_pw_aff mpa)11934 isl::map map::preimage_domain(isl::multi_pw_aff mpa) const
11935 {
11936   if (!ptr || mpa.is_null())
11937     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11938   auto saved_ctx = ctx();
11939   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11940   auto res = isl_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
11941   if (!res)
11942     exception::throw_last_error(saved_ctx);
11943   return manage(res);
11944 }
11945 
preimage_domain(isl::pw_multi_aff pma)11946 isl::map map::preimage_domain(isl::pw_multi_aff pma) const
11947 {
11948   if (!ptr || pma.is_null())
11949     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11950   auto saved_ctx = ctx();
11951   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11952   auto res = isl_map_preimage_domain_pw_multi_aff(copy(), pma.release());
11953   if (!res)
11954     exception::throw_last_error(saved_ctx);
11955   return manage(res);
11956 }
11957 
preimage_domain(const isl::union_pw_multi_aff & upma)11958 isl::union_map map::preimage_domain(const isl::union_pw_multi_aff &upma) const
11959 {
11960   if (!ptr)
11961     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11962   return isl::union_map(*this).preimage_domain(upma);
11963 }
11964 
preimage_range(isl::multi_aff ma)11965 isl::map map::preimage_range(isl::multi_aff ma) const
11966 {
11967   if (!ptr || ma.is_null())
11968     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11969   auto saved_ctx = ctx();
11970   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11971   auto res = isl_map_preimage_range_multi_aff(copy(), ma.release());
11972   if (!res)
11973     exception::throw_last_error(saved_ctx);
11974   return manage(res);
11975 }
11976 
preimage_range(isl::pw_multi_aff pma)11977 isl::map map::preimage_range(isl::pw_multi_aff pma) const
11978 {
11979   if (!ptr || pma.is_null())
11980     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11981   auto saved_ctx = ctx();
11982   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11983   auto res = isl_map_preimage_range_pw_multi_aff(copy(), pma.release());
11984   if (!res)
11985     exception::throw_last_error(saved_ctx);
11986   return manage(res);
11987 }
11988 
preimage_range(const isl::union_pw_multi_aff & upma)11989 isl::union_map map::preimage_range(const isl::union_pw_multi_aff &upma) const
11990 {
11991   if (!ptr)
11992     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11993   return isl::union_map(*this).preimage_range(upma);
11994 }
11995 
product(isl::map map2)11996 isl::map map::product(isl::map map2) const
11997 {
11998   if (!ptr || map2.is_null())
11999     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12000   auto saved_ctx = ctx();
12001   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12002   auto res = isl_map_product(copy(), map2.release());
12003   if (!res)
12004     exception::throw_last_error(saved_ctx);
12005   return manage(res);
12006 }
12007 
product(const isl::union_map & umap2)12008 isl::union_map map::product(const isl::union_map &umap2) const
12009 {
12010   if (!ptr)
12011     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12012   return isl::union_map(*this).product(umap2);
12013 }
12014 
product(const isl::basic_map & map2)12015 isl::map map::product(const isl::basic_map &map2) const
12016 {
12017   if (!ptr)
12018     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12019   return this->product(isl::map(map2));
12020 }
12021 
project_out_all_params()12022 isl::map map::project_out_all_params() const
12023 {
12024   if (!ptr)
12025     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12026   auto saved_ctx = ctx();
12027   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12028   auto res = isl_map_project_out_all_params(copy());
12029   if (!res)
12030     exception::throw_last_error(saved_ctx);
12031   return manage(res);
12032 }
12033 
range()12034 isl::set map::range() const
12035 {
12036   if (!ptr)
12037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12038   auto saved_ctx = ctx();
12039   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12040   auto res = isl_map_range(copy());
12041   if (!res)
12042     exception::throw_last_error(saved_ctx);
12043   return manage(res);
12044 }
12045 
range_factor_domain()12046 isl::map map::range_factor_domain() const
12047 {
12048   if (!ptr)
12049     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12050   auto saved_ctx = ctx();
12051   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12052   auto res = isl_map_range_factor_domain(copy());
12053   if (!res)
12054     exception::throw_last_error(saved_ctx);
12055   return manage(res);
12056 }
12057 
range_factor_range()12058 isl::map map::range_factor_range() const
12059 {
12060   if (!ptr)
12061     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12062   auto saved_ctx = ctx();
12063   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12064   auto res = isl_map_range_factor_range(copy());
12065   if (!res)
12066     exception::throw_last_error(saved_ctx);
12067   return manage(res);
12068 }
12069 
range_lattice_tile()12070 isl::fixed_box map::range_lattice_tile() const
12071 {
12072   if (!ptr)
12073     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12074   auto saved_ctx = ctx();
12075   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12076   auto res = isl_map_get_range_lattice_tile(get());
12077   if (!res)
12078     exception::throw_last_error(saved_ctx);
12079   return manage(res);
12080 }
12081 
get_range_lattice_tile()12082 isl::fixed_box map::get_range_lattice_tile() const
12083 {
12084   return range_lattice_tile();
12085 }
12086 
range_map()12087 isl::union_map map::range_map() const
12088 {
12089   if (!ptr)
12090     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12091   return isl::union_map(*this).range_map();
12092 }
12093 
range_product(isl::map map2)12094 isl::map map::range_product(isl::map map2) const
12095 {
12096   if (!ptr || map2.is_null())
12097     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12098   auto saved_ctx = ctx();
12099   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12100   auto res = isl_map_range_product(copy(), map2.release());
12101   if (!res)
12102     exception::throw_last_error(saved_ctx);
12103   return manage(res);
12104 }
12105 
range_product(const isl::union_map & umap2)12106 isl::union_map map::range_product(const isl::union_map &umap2) const
12107 {
12108   if (!ptr)
12109     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12110   return isl::union_map(*this).range_product(umap2);
12111 }
12112 
range_product(const isl::basic_map & map2)12113 isl::map map::range_product(const isl::basic_map &map2) const
12114 {
12115   if (!ptr)
12116     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12117   return this->range_product(isl::map(map2));
12118 }
12119 
range_reverse()12120 isl::map map::range_reverse() const
12121 {
12122   if (!ptr)
12123     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12124   auto saved_ctx = ctx();
12125   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12126   auto res = isl_map_range_reverse(copy());
12127   if (!res)
12128     exception::throw_last_error(saved_ctx);
12129   return manage(res);
12130 }
12131 
range_simple_fixed_box_hull()12132 isl::fixed_box map::range_simple_fixed_box_hull() const
12133 {
12134   if (!ptr)
12135     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12136   auto saved_ctx = ctx();
12137   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12138   auto res = isl_map_get_range_simple_fixed_box_hull(get());
12139   if (!res)
12140     exception::throw_last_error(saved_ctx);
12141   return manage(res);
12142 }
12143 
get_range_simple_fixed_box_hull()12144 isl::fixed_box map::get_range_simple_fixed_box_hull() const
12145 {
12146   return range_simple_fixed_box_hull();
12147 }
12148 
range_tuple_dim()12149 unsigned map::range_tuple_dim() const
12150 {
12151   if (!ptr)
12152     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12153   auto saved_ctx = ctx();
12154   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12155   auto res = isl_map_range_tuple_dim(get());
12156   if (res < 0)
12157     exception::throw_last_error(saved_ctx);
12158   return res;
12159 }
12160 
range_tuple_id()12161 isl::id map::range_tuple_id() const
12162 {
12163   if (!ptr)
12164     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12165   auto saved_ctx = ctx();
12166   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12167   auto res = isl_map_get_range_tuple_id(get());
12168   if (!res)
12169     exception::throw_last_error(saved_ctx);
12170   return manage(res);
12171 }
12172 
get_range_tuple_id()12173 isl::id map::get_range_tuple_id() const
12174 {
12175   return range_tuple_id();
12176 }
12177 
reverse()12178 isl::map map::reverse() const
12179 {
12180   if (!ptr)
12181     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12182   auto saved_ctx = ctx();
12183   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12184   auto res = isl_map_reverse(copy());
12185   if (!res)
12186     exception::throw_last_error(saved_ctx);
12187   return manage(res);
12188 }
12189 
sample()12190 isl::basic_map map::sample() 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_sample(copy());
12197   if (!res)
12198     exception::throw_last_error(saved_ctx);
12199   return manage(res);
12200 }
12201 
set_domain_tuple(isl::id id)12202 isl::map map::set_domain_tuple(isl::id id) const
12203 {
12204   if (!ptr || id.is_null())
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_set_domain_tuple_id(copy(), id.release());
12209   if (!res)
12210     exception::throw_last_error(saved_ctx);
12211   return manage(res);
12212 }
12213 
set_domain_tuple(const std::string & id)12214 isl::map map::set_domain_tuple(const std::string &id) const
12215 {
12216   if (!ptr)
12217     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12218   return this->set_domain_tuple(isl::id(ctx(), id));
12219 }
12220 
set_range_tuple(isl::id id)12221 isl::map map::set_range_tuple(isl::id id) const
12222 {
12223   if (!ptr || id.is_null())
12224     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12225   auto saved_ctx = ctx();
12226   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12227   auto res = isl_map_set_range_tuple_id(copy(), id.release());
12228   if (!res)
12229     exception::throw_last_error(saved_ctx);
12230   return manage(res);
12231 }
12232 
set_range_tuple(const std::string & id)12233 isl::map map::set_range_tuple(const std::string &id) const
12234 {
12235   if (!ptr)
12236     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12237   return this->set_range_tuple(isl::id(ctx(), id));
12238 }
12239 
space()12240 isl::space map::space() const
12241 {
12242   if (!ptr)
12243     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12244   auto saved_ctx = ctx();
12245   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12246   auto res = isl_map_get_space(get());
12247   if (!res)
12248     exception::throw_last_error(saved_ctx);
12249   return manage(res);
12250 }
12251 
get_space()12252 isl::space map::get_space() const
12253 {
12254   return space();
12255 }
12256 
subtract(isl::map map2)12257 isl::map map::subtract(isl::map map2) const
12258 {
12259   if (!ptr || map2.is_null())
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_subtract(copy(), map2.release());
12264   if (!res)
12265     exception::throw_last_error(saved_ctx);
12266   return manage(res);
12267 }
12268 
subtract(const isl::union_map & umap2)12269 isl::union_map map::subtract(const isl::union_map &umap2) const
12270 {
12271   if (!ptr)
12272     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12273   return isl::union_map(*this).subtract(umap2);
12274 }
12275 
subtract(const isl::basic_map & map2)12276 isl::map map::subtract(const isl::basic_map &map2) const
12277 {
12278   if (!ptr)
12279     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12280   return this->subtract(isl::map(map2));
12281 }
12282 
subtract_domain(const isl::union_set & dom)12283 isl::union_map map::subtract_domain(const isl::union_set &dom) const
12284 {
12285   if (!ptr)
12286     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12287   return isl::union_map(*this).subtract_domain(dom);
12288 }
12289 
subtract_range(const isl::union_set & dom)12290 isl::union_map map::subtract_range(const isl::union_set &dom) const
12291 {
12292   if (!ptr)
12293     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12294   return isl::union_map(*this).subtract_range(dom);
12295 }
12296 
to_list()12297 isl::map_list map::to_list() const
12298 {
12299   if (!ptr)
12300     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12301   auto saved_ctx = ctx();
12302   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12303   auto res = isl_map_to_list(copy());
12304   if (!res)
12305     exception::throw_last_error(saved_ctx);
12306   return manage(res);
12307 }
12308 
to_union_map()12309 isl::union_map map::to_union_map() const
12310 {
12311   if (!ptr)
12312     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12313   auto saved_ctx = ctx();
12314   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12315   auto res = isl_map_to_union_map(copy());
12316   if (!res)
12317     exception::throw_last_error(saved_ctx);
12318   return manage(res);
12319 }
12320 
uncurry()12321 isl::map map::uncurry() const
12322 {
12323   if (!ptr)
12324     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12325   auto saved_ctx = ctx();
12326   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12327   auto res = isl_map_uncurry(copy());
12328   if (!res)
12329     exception::throw_last_error(saved_ctx);
12330   return manage(res);
12331 }
12332 
unite(isl::map map2)12333 isl::map map::unite(isl::map map2) const
12334 {
12335   if (!ptr || map2.is_null())
12336     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12337   auto saved_ctx = ctx();
12338   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12339   auto res = isl_map_union(copy(), map2.release());
12340   if (!res)
12341     exception::throw_last_error(saved_ctx);
12342   return manage(res);
12343 }
12344 
unite(const isl::union_map & umap2)12345 isl::union_map map::unite(const isl::union_map &umap2) const
12346 {
12347   if (!ptr)
12348     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12349   return isl::union_map(*this).unite(umap2);
12350 }
12351 
unite(const isl::basic_map & map2)12352 isl::map map::unite(const isl::basic_map &map2) const
12353 {
12354   if (!ptr)
12355     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12356   return this->unite(isl::map(map2));
12357 }
12358 
universe(isl::space space)12359 isl::map map::universe(isl::space space)
12360 {
12361   if (space.is_null())
12362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12363   auto saved_ctx = space.ctx();
12364   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12365   auto res = isl_map_universe(space.release());
12366   if (!res)
12367     exception::throw_last_error(saved_ctx);
12368   return manage(res);
12369 }
12370 
unshifted_simple_hull()12371 isl::basic_map map::unshifted_simple_hull() const
12372 {
12373   if (!ptr)
12374     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12375   auto saved_ctx = ctx();
12376   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12377   auto res = isl_map_unshifted_simple_hull(copy());
12378   if (!res)
12379     exception::throw_last_error(saved_ctx);
12380   return manage(res);
12381 }
12382 
upper_bound(isl::multi_pw_aff upper)12383 isl::map map::upper_bound(isl::multi_pw_aff upper) const
12384 {
12385   if (!ptr || upper.is_null())
12386     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12387   auto saved_ctx = ctx();
12388   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12389   auto res = isl_map_upper_bound_multi_pw_aff(copy(), upper.release());
12390   if (!res)
12391     exception::throw_last_error(saved_ctx);
12392   return manage(res);
12393 }
12394 
wrap()12395 isl::set map::wrap() const
12396 {
12397   if (!ptr)
12398     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12399   auto saved_ctx = ctx();
12400   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12401   auto res = isl_map_wrap(copy());
12402   if (!res)
12403     exception::throw_last_error(saved_ctx);
12404   return manage(res);
12405 }
12406 
zip()12407 isl::map map::zip() const
12408 {
12409   if (!ptr)
12410     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12411   auto saved_ctx = ctx();
12412   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12413   auto res = isl_map_zip(copy());
12414   if (!res)
12415     exception::throw_last_error(saved_ctx);
12416   return manage(res);
12417 }
12418 
12419 inline std::ostream &operator<<(std::ostream &os, const map &obj)
12420 {
12421   if (!obj.get())
12422     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12423   auto saved_ctx = isl_map_get_ctx(obj.get());
12424   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12425   char *str = isl_map_to_str(obj.get());
12426   if (!str)
12427     exception::throw_last_error(saved_ctx);
12428   os << str;
12429   free(str);
12430   return os;
12431 }
12432 
12433 // implementations for isl::map_list
manage(__isl_take isl_map_list * ptr)12434 map_list manage(__isl_take isl_map_list *ptr) {
12435   if (!ptr)
12436     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12437   return map_list(ptr);
12438 }
manage_copy(__isl_keep isl_map_list * ptr)12439 map_list manage_copy(__isl_keep isl_map_list *ptr) {
12440   if (!ptr)
12441     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12442   auto saved_ctx = isl_map_list_get_ctx(ptr);
12443   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12444   ptr = isl_map_list_copy(ptr);
12445   if (!ptr)
12446     exception::throw_last_error(saved_ctx);
12447   return map_list(ptr);
12448 }
12449 
map_list()12450 map_list::map_list()
12451     : ptr(nullptr) {}
12452 
map_list(const map_list & obj)12453 map_list::map_list(const map_list &obj)
12454     : ptr(nullptr)
12455 {
12456   if (!obj.ptr)
12457     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12458   auto saved_ctx = isl_map_list_get_ctx(obj.ptr);
12459   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12460   ptr = obj.copy();
12461   if (!ptr)
12462     exception::throw_last_error(saved_ctx);
12463 }
12464 
map_list(__isl_take isl_map_list * ptr)12465 map_list::map_list(__isl_take isl_map_list *ptr)
12466     : ptr(ptr) {}
12467 
map_list(isl::ctx ctx,int n)12468 map_list::map_list(isl::ctx ctx, int n)
12469 {
12470   auto saved_ctx = ctx;
12471   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12472   auto res = isl_map_list_alloc(ctx.release(), n);
12473   if (!res)
12474     exception::throw_last_error(saved_ctx);
12475   ptr = res;
12476 }
12477 
map_list(isl::map el)12478 map_list::map_list(isl::map el)
12479 {
12480   if (el.is_null())
12481     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12482   auto saved_ctx = el.ctx();
12483   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12484   auto res = isl_map_list_from_map(el.release());
12485   if (!res)
12486     exception::throw_last_error(saved_ctx);
12487   ptr = res;
12488 }
12489 
map_list(isl::ctx ctx,const std::string & str)12490 map_list::map_list(isl::ctx ctx, const std::string &str)
12491 {
12492   auto saved_ctx = ctx;
12493   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12494   auto res = isl_map_list_read_from_str(ctx.release(), str.c_str());
12495   if (!res)
12496     exception::throw_last_error(saved_ctx);
12497   ptr = res;
12498 }
12499 
12500 map_list &map_list::operator=(map_list obj) {
12501   std::swap(this->ptr, obj.ptr);
12502   return *this;
12503 }
12504 
~map_list()12505 map_list::~map_list() {
12506   if (ptr)
12507     isl_map_list_free(ptr);
12508 }
12509 
copy()12510 __isl_give isl_map_list *map_list::copy() const & {
12511   return isl_map_list_copy(ptr);
12512 }
12513 
get()12514 __isl_keep isl_map_list *map_list::get() const {
12515   return ptr;
12516 }
12517 
release()12518 __isl_give isl_map_list *map_list::release() {
12519   isl_map_list *tmp = ptr;
12520   ptr = nullptr;
12521   return tmp;
12522 }
12523 
is_null()12524 bool map_list::is_null() const {
12525   return ptr == nullptr;
12526 }
12527 
ctx()12528 isl::ctx map_list::ctx() const {
12529   return isl::ctx(isl_map_list_get_ctx(ptr));
12530 }
12531 
add(isl::map el)12532 isl::map_list map_list::add(isl::map el) const
12533 {
12534   if (!ptr || el.is_null())
12535     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12536   auto saved_ctx = ctx();
12537   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12538   auto res = isl_map_list_add(copy(), el.release());
12539   if (!res)
12540     exception::throw_last_error(saved_ctx);
12541   return manage(res);
12542 }
12543 
at(int index)12544 isl::map map_list::at(int index) const
12545 {
12546   if (!ptr)
12547     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12548   auto saved_ctx = ctx();
12549   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12550   auto res = isl_map_list_get_at(get(), index);
12551   if (!res)
12552     exception::throw_last_error(saved_ctx);
12553   return manage(res);
12554 }
12555 
get_at(int index)12556 isl::map map_list::get_at(int index) const
12557 {
12558   return at(index);
12559 }
12560 
clear()12561 isl::map_list map_list::clear() const
12562 {
12563   if (!ptr)
12564     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12565   auto saved_ctx = ctx();
12566   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12567   auto res = isl_map_list_clear(copy());
12568   if (!res)
12569     exception::throw_last_error(saved_ctx);
12570   return manage(res);
12571 }
12572 
concat(isl::map_list list2)12573 isl::map_list map_list::concat(isl::map_list list2) const
12574 {
12575   if (!ptr || list2.is_null())
12576     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12577   auto saved_ctx = ctx();
12578   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12579   auto res = isl_map_list_concat(copy(), list2.release());
12580   if (!res)
12581     exception::throw_last_error(saved_ctx);
12582   return manage(res);
12583 }
12584 
drop(unsigned int first,unsigned int n)12585 isl::map_list map_list::drop(unsigned int first, unsigned int n) const
12586 {
12587   if (!ptr)
12588     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12589   auto saved_ctx = ctx();
12590   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12591   auto res = isl_map_list_drop(copy(), first, n);
12592   if (!res)
12593     exception::throw_last_error(saved_ctx);
12594   return manage(res);
12595 }
12596 
foreach(const std::function<void (isl::map)> & fn)12597 void map_list::foreach(const std::function<void(isl::map)> &fn) const
12598 {
12599   if (!ptr)
12600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12601   auto saved_ctx = ctx();
12602   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12603   struct fn_data {
12604     std::function<void(isl::map)> func;
12605     std::exception_ptr eptr;
12606   } fn_data = { fn };
12607   auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
12608     auto *data = static_cast<struct fn_data *>(arg_1);
12609     ISL_CPP_TRY {
12610       (data->func)(manage(arg_0));
12611       return isl_stat_ok;
12612     } ISL_CPP_CATCH_ALL {
12613       data->eptr = std::current_exception();
12614       return isl_stat_error;
12615     }
12616   };
12617   auto res = isl_map_list_foreach(get(), fn_lambda, &fn_data);
12618   if (fn_data.eptr)
12619     std::rethrow_exception(fn_data.eptr);
12620   if (res < 0)
12621     exception::throw_last_error(saved_ctx);
12622   return;
12623 }
12624 
insert(unsigned int pos,isl::map el)12625 isl::map_list map_list::insert(unsigned int pos, isl::map el) const
12626 {
12627   if (!ptr || el.is_null())
12628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12629   auto saved_ctx = ctx();
12630   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12631   auto res = isl_map_list_insert(copy(), pos, el.release());
12632   if (!res)
12633     exception::throw_last_error(saved_ctx);
12634   return manage(res);
12635 }
12636 
size()12637 unsigned map_list::size() const
12638 {
12639   if (!ptr)
12640     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12641   auto saved_ctx = ctx();
12642   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12643   auto res = isl_map_list_size(get());
12644   if (res < 0)
12645     exception::throw_last_error(saved_ctx);
12646   return res;
12647 }
12648 
12649 inline std::ostream &operator<<(std::ostream &os, const map_list &obj)
12650 {
12651   if (!obj.get())
12652     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12653   auto saved_ctx = isl_map_list_get_ctx(obj.get());
12654   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12655   char *str = isl_map_list_to_str(obj.get());
12656   if (!str)
12657     exception::throw_last_error(saved_ctx);
12658   os << str;
12659   free(str);
12660   return os;
12661 }
12662 
12663 // implementations for isl::multi_aff
manage(__isl_take isl_multi_aff * ptr)12664 multi_aff manage(__isl_take isl_multi_aff *ptr) {
12665   if (!ptr)
12666     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12667   return multi_aff(ptr);
12668 }
manage_copy(__isl_keep isl_multi_aff * ptr)12669 multi_aff manage_copy(__isl_keep isl_multi_aff *ptr) {
12670   if (!ptr)
12671     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12672   auto saved_ctx = isl_multi_aff_get_ctx(ptr);
12673   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12674   ptr = isl_multi_aff_copy(ptr);
12675   if (!ptr)
12676     exception::throw_last_error(saved_ctx);
12677   return multi_aff(ptr);
12678 }
12679 
multi_aff()12680 multi_aff::multi_aff()
12681     : ptr(nullptr) {}
12682 
multi_aff(const multi_aff & obj)12683 multi_aff::multi_aff(const multi_aff &obj)
12684     : ptr(nullptr)
12685 {
12686   if (!obj.ptr)
12687     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12688   auto saved_ctx = isl_multi_aff_get_ctx(obj.ptr);
12689   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12690   ptr = obj.copy();
12691   if (!ptr)
12692     exception::throw_last_error(saved_ctx);
12693 }
12694 
multi_aff(__isl_take isl_multi_aff * ptr)12695 multi_aff::multi_aff(__isl_take isl_multi_aff *ptr)
12696     : ptr(ptr) {}
12697 
multi_aff(isl::aff aff)12698 multi_aff::multi_aff(isl::aff aff)
12699 {
12700   if (aff.is_null())
12701     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12702   auto saved_ctx = aff.ctx();
12703   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12704   auto res = isl_multi_aff_from_aff(aff.release());
12705   if (!res)
12706     exception::throw_last_error(saved_ctx);
12707   ptr = res;
12708 }
12709 
multi_aff(isl::space space,isl::aff_list list)12710 multi_aff::multi_aff(isl::space space, isl::aff_list list)
12711 {
12712   if (space.is_null() || list.is_null())
12713     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12714   auto saved_ctx = space.ctx();
12715   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12716   auto res = isl_multi_aff_from_aff_list(space.release(), list.release());
12717   if (!res)
12718     exception::throw_last_error(saved_ctx);
12719   ptr = res;
12720 }
12721 
multi_aff(isl::ctx ctx,const std::string & str)12722 multi_aff::multi_aff(isl::ctx ctx, const std::string &str)
12723 {
12724   auto saved_ctx = ctx;
12725   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12726   auto res = isl_multi_aff_read_from_str(ctx.release(), str.c_str());
12727   if (!res)
12728     exception::throw_last_error(saved_ctx);
12729   ptr = res;
12730 }
12731 
12732 multi_aff &multi_aff::operator=(multi_aff obj) {
12733   std::swap(this->ptr, obj.ptr);
12734   return *this;
12735 }
12736 
~multi_aff()12737 multi_aff::~multi_aff() {
12738   if (ptr)
12739     isl_multi_aff_free(ptr);
12740 }
12741 
copy()12742 __isl_give isl_multi_aff *multi_aff::copy() const & {
12743   return isl_multi_aff_copy(ptr);
12744 }
12745 
get()12746 __isl_keep isl_multi_aff *multi_aff::get() const {
12747   return ptr;
12748 }
12749 
release()12750 __isl_give isl_multi_aff *multi_aff::release() {
12751   isl_multi_aff *tmp = ptr;
12752   ptr = nullptr;
12753   return tmp;
12754 }
12755 
is_null()12756 bool multi_aff::is_null() const {
12757   return ptr == nullptr;
12758 }
12759 
ctx()12760 isl::ctx multi_aff::ctx() const {
12761   return isl::ctx(isl_multi_aff_get_ctx(ptr));
12762 }
12763 
add(isl::multi_aff multi2)12764 isl::multi_aff multi_aff::add(isl::multi_aff multi2) const
12765 {
12766   if (!ptr || multi2.is_null())
12767     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12768   auto saved_ctx = ctx();
12769   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12770   auto res = isl_multi_aff_add(copy(), multi2.release());
12771   if (!res)
12772     exception::throw_last_error(saved_ctx);
12773   return manage(res);
12774 }
12775 
add(const isl::multi_pw_aff & multi2)12776 isl::multi_pw_aff multi_aff::add(const isl::multi_pw_aff &multi2) const
12777 {
12778   if (!ptr)
12779     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12780   return isl::pw_multi_aff(*this).add(multi2);
12781 }
12782 
add(const isl::multi_union_pw_aff & multi2)12783 isl::multi_union_pw_aff multi_aff::add(const isl::multi_union_pw_aff &multi2) const
12784 {
12785   if (!ptr)
12786     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12787   return isl::pw_multi_aff(*this).add(multi2);
12788 }
12789 
add(const isl::pw_multi_aff & pma2)12790 isl::pw_multi_aff multi_aff::add(const isl::pw_multi_aff &pma2) const
12791 {
12792   if (!ptr)
12793     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12794   return isl::pw_multi_aff(*this).add(pma2);
12795 }
12796 
add(const isl::union_pw_multi_aff & upma2)12797 isl::union_pw_multi_aff multi_aff::add(const isl::union_pw_multi_aff &upma2) const
12798 {
12799   if (!ptr)
12800     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12801   return isl::pw_multi_aff(*this).add(upma2);
12802 }
12803 
add(const isl::aff & multi2)12804 isl::multi_aff multi_aff::add(const isl::aff &multi2) const
12805 {
12806   if (!ptr)
12807     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12808   return this->add(isl::multi_aff(multi2));
12809 }
12810 
add_constant(isl::multi_val mv)12811 isl::multi_aff multi_aff::add_constant(isl::multi_val mv) const
12812 {
12813   if (!ptr || mv.is_null())
12814     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12815   auto saved_ctx = ctx();
12816   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12817   auto res = isl_multi_aff_add_constant_multi_val(copy(), mv.release());
12818   if (!res)
12819     exception::throw_last_error(saved_ctx);
12820   return manage(res);
12821 }
12822 
add_constant(isl::val v)12823 isl::multi_aff multi_aff::add_constant(isl::val v) const
12824 {
12825   if (!ptr || v.is_null())
12826     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12827   auto saved_ctx = ctx();
12828   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12829   auto res = isl_multi_aff_add_constant_val(copy(), v.release());
12830   if (!res)
12831     exception::throw_last_error(saved_ctx);
12832   return manage(res);
12833 }
12834 
add_constant(long v)12835 isl::multi_aff multi_aff::add_constant(long v) const
12836 {
12837   if (!ptr)
12838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12839   return this->add_constant(isl::val(ctx(), v));
12840 }
12841 
apply(const isl::union_pw_multi_aff & upma2)12842 isl::union_pw_multi_aff multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
12843 {
12844   if (!ptr)
12845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12846   return isl::pw_multi_aff(*this).apply(upma2);
12847 }
12848 
as_map()12849 isl::map multi_aff::as_map() const
12850 {
12851   if (!ptr)
12852     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12853   auto saved_ctx = ctx();
12854   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12855   auto res = isl_multi_aff_as_map(copy());
12856   if (!res)
12857     exception::throw_last_error(saved_ctx);
12858   return manage(res);
12859 }
12860 
as_multi_aff()12861 isl::multi_aff multi_aff::as_multi_aff() const
12862 {
12863   if (!ptr)
12864     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12865   return isl::pw_multi_aff(*this).as_multi_aff();
12866 }
12867 
as_multi_union_pw_aff()12868 isl::multi_union_pw_aff multi_aff::as_multi_union_pw_aff() const
12869 {
12870   if (!ptr)
12871     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12872   return isl::pw_multi_aff(*this).as_multi_union_pw_aff();
12873 }
12874 
as_pw_multi_aff()12875 isl::pw_multi_aff multi_aff::as_pw_multi_aff() const
12876 {
12877   if (!ptr)
12878     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12879   return isl::pw_multi_aff(*this).as_pw_multi_aff();
12880 }
12881 
as_set()12882 isl::set multi_aff::as_set() const
12883 {
12884   if (!ptr)
12885     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12886   auto saved_ctx = ctx();
12887   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12888   auto res = isl_multi_aff_as_set(copy());
12889   if (!res)
12890     exception::throw_last_error(saved_ctx);
12891   return manage(res);
12892 }
12893 
as_union_map()12894 isl::union_map multi_aff::as_union_map() const
12895 {
12896   if (!ptr)
12897     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12898   return isl::pw_multi_aff(*this).as_union_map();
12899 }
12900 
at(int pos)12901 isl::aff multi_aff::at(int pos) 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_multi_aff_get_at(get(), pos);
12908   if (!res)
12909     exception::throw_last_error(saved_ctx);
12910   return manage(res);
12911 }
12912 
get_at(int pos)12913 isl::aff multi_aff::get_at(int pos) const
12914 {
12915   return at(pos);
12916 }
12917 
bind(isl::multi_id tuple)12918 isl::basic_set multi_aff::bind(isl::multi_id tuple) const
12919 {
12920   if (!ptr || tuple.is_null())
12921     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12922   auto saved_ctx = ctx();
12923   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12924   auto res = isl_multi_aff_bind(copy(), tuple.release());
12925   if (!res)
12926     exception::throw_last_error(saved_ctx);
12927   return manage(res);
12928 }
12929 
bind_domain(isl::multi_id tuple)12930 isl::multi_aff multi_aff::bind_domain(isl::multi_id tuple) const
12931 {
12932   if (!ptr || tuple.is_null())
12933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12934   auto saved_ctx = ctx();
12935   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12936   auto res = isl_multi_aff_bind_domain(copy(), tuple.release());
12937   if (!res)
12938     exception::throw_last_error(saved_ctx);
12939   return manage(res);
12940 }
12941 
bind_domain_wrapped_domain(isl::multi_id tuple)12942 isl::multi_aff multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
12943 {
12944   if (!ptr || tuple.is_null())
12945     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12946   auto saved_ctx = ctx();
12947   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12948   auto res = isl_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
12949   if (!res)
12950     exception::throw_last_error(saved_ctx);
12951   return manage(res);
12952 }
12953 
coalesce()12954 isl::pw_multi_aff multi_aff::coalesce() const
12955 {
12956   if (!ptr)
12957     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12958   return isl::pw_multi_aff(*this).coalesce();
12959 }
12960 
constant_multi_val()12961 isl::multi_val multi_aff::constant_multi_val() const
12962 {
12963   if (!ptr)
12964     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12965   auto saved_ctx = ctx();
12966   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12967   auto res = isl_multi_aff_get_constant_multi_val(get());
12968   if (!res)
12969     exception::throw_last_error(saved_ctx);
12970   return manage(res);
12971 }
12972 
get_constant_multi_val()12973 isl::multi_val multi_aff::get_constant_multi_val() const
12974 {
12975   return constant_multi_val();
12976 }
12977 
domain()12978 isl::set multi_aff::domain() const
12979 {
12980   if (!ptr)
12981     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12982   return isl::pw_multi_aff(*this).domain();
12983 }
12984 
domain_map(isl::space space)12985 isl::multi_aff multi_aff::domain_map(isl::space space)
12986 {
12987   if (space.is_null())
12988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12989   auto saved_ctx = space.ctx();
12990   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12991   auto res = isl_multi_aff_domain_map(space.release());
12992   if (!res)
12993     exception::throw_last_error(saved_ctx);
12994   return manage(res);
12995 }
12996 
extract_pw_multi_aff(const isl::space & space)12997 isl::pw_multi_aff multi_aff::extract_pw_multi_aff(const isl::space &space) const
12998 {
12999   if (!ptr)
13000     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13001   return isl::pw_multi_aff(*this).extract_pw_multi_aff(space);
13002 }
13003 
flat_range_product(isl::multi_aff multi2)13004 isl::multi_aff multi_aff::flat_range_product(isl::multi_aff multi2) const
13005 {
13006   if (!ptr || multi2.is_null())
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_multi_aff_flat_range_product(copy(), multi2.release());
13011   if (!res)
13012     exception::throw_last_error(saved_ctx);
13013   return manage(res);
13014 }
13015 
flat_range_product(const isl::multi_pw_aff & multi2)13016 isl::multi_pw_aff multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
13017 {
13018   if (!ptr)
13019     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13020   return isl::pw_multi_aff(*this).flat_range_product(multi2);
13021 }
13022 
flat_range_product(const isl::multi_union_pw_aff & multi2)13023 isl::multi_union_pw_aff multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
13024 {
13025   if (!ptr)
13026     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13027   return isl::pw_multi_aff(*this).flat_range_product(multi2);
13028 }
13029 
flat_range_product(const isl::pw_multi_aff & pma2)13030 isl::pw_multi_aff multi_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
13031 {
13032   if (!ptr)
13033     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13034   return isl::pw_multi_aff(*this).flat_range_product(pma2);
13035 }
13036 
flat_range_product(const isl::union_pw_multi_aff & upma2)13037 isl::union_pw_multi_aff multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
13038 {
13039   if (!ptr)
13040     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13041   return isl::pw_multi_aff(*this).flat_range_product(upma2);
13042 }
13043 
flat_range_product(const isl::aff & multi2)13044 isl::multi_aff multi_aff::flat_range_product(const isl::aff &multi2) const
13045 {
13046   if (!ptr)
13047     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13048   return this->flat_range_product(isl::multi_aff(multi2));
13049 }
13050 
floor()13051 isl::multi_aff multi_aff::floor() const
13052 {
13053   if (!ptr)
13054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13055   auto saved_ctx = ctx();
13056   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13057   auto res = isl_multi_aff_floor(copy());
13058   if (!res)
13059     exception::throw_last_error(saved_ctx);
13060   return manage(res);
13061 }
13062 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)13063 void multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
13064 {
13065   if (!ptr)
13066     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13067   return isl::pw_multi_aff(*this).foreach_piece(fn);
13068 }
13069 
gist(isl::set context)13070 isl::multi_aff multi_aff::gist(isl::set context) const
13071 {
13072   if (!ptr || context.is_null())
13073     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13074   auto saved_ctx = ctx();
13075   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13076   auto res = isl_multi_aff_gist(copy(), context.release());
13077   if (!res)
13078     exception::throw_last_error(saved_ctx);
13079   return manage(res);
13080 }
13081 
gist(const isl::union_set & context)13082 isl::union_pw_multi_aff multi_aff::gist(const isl::union_set &context) const
13083 {
13084   if (!ptr)
13085     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13086   return isl::pw_multi_aff(*this).gist(context);
13087 }
13088 
gist(const isl::basic_set & context)13089 isl::multi_aff multi_aff::gist(const isl::basic_set &context) const
13090 {
13091   if (!ptr)
13092     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13093   return this->gist(isl::set(context));
13094 }
13095 
gist(const isl::point & context)13096 isl::multi_aff multi_aff::gist(const isl::point &context) const
13097 {
13098   if (!ptr)
13099     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13100   return this->gist(isl::set(context));
13101 }
13102 
has_range_tuple_id()13103 bool multi_aff::has_range_tuple_id() const
13104 {
13105   if (!ptr)
13106     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13107   auto saved_ctx = ctx();
13108   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13109   auto res = isl_multi_aff_has_range_tuple_id(get());
13110   if (res < 0)
13111     exception::throw_last_error(saved_ctx);
13112   return res;
13113 }
13114 
identity()13115 isl::multi_aff multi_aff::identity() const
13116 {
13117   if (!ptr)
13118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13119   auto saved_ctx = ctx();
13120   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13121   auto res = isl_multi_aff_identity_multi_aff(copy());
13122   if (!res)
13123     exception::throw_last_error(saved_ctx);
13124   return manage(res);
13125 }
13126 
identity_on_domain(isl::space space)13127 isl::multi_aff multi_aff::identity_on_domain(isl::space space)
13128 {
13129   if (space.is_null())
13130     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13131   auto saved_ctx = space.ctx();
13132   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13133   auto res = isl_multi_aff_identity_on_domain_space(space.release());
13134   if (!res)
13135     exception::throw_last_error(saved_ctx);
13136   return manage(res);
13137 }
13138 
insert_domain(isl::space domain)13139 isl::multi_aff multi_aff::insert_domain(isl::space domain) const
13140 {
13141   if (!ptr || domain.is_null())
13142     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13143   auto saved_ctx = ctx();
13144   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13145   auto res = isl_multi_aff_insert_domain(copy(), domain.release());
13146   if (!res)
13147     exception::throw_last_error(saved_ctx);
13148   return manage(res);
13149 }
13150 
intersect_domain(const isl::set & set)13151 isl::pw_multi_aff multi_aff::intersect_domain(const isl::set &set) const
13152 {
13153   if (!ptr)
13154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13155   return isl::pw_multi_aff(*this).intersect_domain(set);
13156 }
13157 
intersect_domain(const isl::space & space)13158 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::space &space) const
13159 {
13160   if (!ptr)
13161     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13162   return isl::pw_multi_aff(*this).intersect_domain(space);
13163 }
13164 
intersect_domain(const isl::union_set & uset)13165 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::union_set &uset) const
13166 {
13167   if (!ptr)
13168     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13169   return isl::pw_multi_aff(*this).intersect_domain(uset);
13170 }
13171 
intersect_domain_wrapped_domain(const isl::union_set & uset)13172 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
13173 {
13174   if (!ptr)
13175     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13176   return isl::pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
13177 }
13178 
intersect_domain_wrapped_range(const isl::union_set & uset)13179 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
13180 {
13181   if (!ptr)
13182     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13183   return isl::pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
13184 }
13185 
intersect_params(const isl::set & set)13186 isl::pw_multi_aff multi_aff::intersect_params(const isl::set &set) const
13187 {
13188   if (!ptr)
13189     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13190   return isl::pw_multi_aff(*this).intersect_params(set);
13191 }
13192 
involves_locals()13193 bool multi_aff::involves_locals() const
13194 {
13195   if (!ptr)
13196     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13197   auto saved_ctx = ctx();
13198   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13199   auto res = isl_multi_aff_involves_locals(get());
13200   if (res < 0)
13201     exception::throw_last_error(saved_ctx);
13202   return res;
13203 }
13204 
involves_nan()13205 bool multi_aff::involves_nan() const
13206 {
13207   if (!ptr)
13208     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13209   auto saved_ctx = ctx();
13210   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13211   auto res = isl_multi_aff_involves_nan(get());
13212   if (res < 0)
13213     exception::throw_last_error(saved_ctx);
13214   return res;
13215 }
13216 
involves_param(const isl::id & id)13217 bool multi_aff::involves_param(const isl::id &id) const
13218 {
13219   if (!ptr)
13220     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13221   return isl::pw_multi_aff(*this).involves_param(id);
13222 }
13223 
involves_param(const std::string & id)13224 bool multi_aff::involves_param(const std::string &id) const
13225 {
13226   if (!ptr)
13227     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13228   return this->involves_param(isl::id(ctx(), id));
13229 }
13230 
involves_param(const isl::id_list & list)13231 bool multi_aff::involves_param(const isl::id_list &list) const
13232 {
13233   if (!ptr)
13234     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13235   return isl::pw_multi_aff(*this).involves_param(list);
13236 }
13237 
isa_multi_aff()13238 bool multi_aff::isa_multi_aff() const
13239 {
13240   if (!ptr)
13241     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13242   return isl::pw_multi_aff(*this).isa_multi_aff();
13243 }
13244 
isa_pw_multi_aff()13245 bool multi_aff::isa_pw_multi_aff() const
13246 {
13247   if (!ptr)
13248     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13249   return isl::pw_multi_aff(*this).isa_pw_multi_aff();
13250 }
13251 
list()13252 isl::aff_list multi_aff::list() const
13253 {
13254   if (!ptr)
13255     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13256   auto saved_ctx = ctx();
13257   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13258   auto res = isl_multi_aff_get_list(get());
13259   if (!res)
13260     exception::throw_last_error(saved_ctx);
13261   return manage(res);
13262 }
13263 
get_list()13264 isl::aff_list multi_aff::get_list() const
13265 {
13266   return list();
13267 }
13268 
max(const isl::multi_pw_aff & multi2)13269 isl::multi_pw_aff multi_aff::max(const isl::multi_pw_aff &multi2) const
13270 {
13271   if (!ptr)
13272     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13273   return isl::pw_multi_aff(*this).max(multi2);
13274 }
13275 
max_multi_val()13276 isl::multi_val multi_aff::max_multi_val() const
13277 {
13278   if (!ptr)
13279     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13280   return isl::pw_multi_aff(*this).max_multi_val();
13281 }
13282 
min(const isl::multi_pw_aff & multi2)13283 isl::multi_pw_aff multi_aff::min(const isl::multi_pw_aff &multi2) const
13284 {
13285   if (!ptr)
13286     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13287   return isl::pw_multi_aff(*this).min(multi2);
13288 }
13289 
min_multi_val()13290 isl::multi_val multi_aff::min_multi_val() const
13291 {
13292   if (!ptr)
13293     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13294   return isl::pw_multi_aff(*this).min_multi_val();
13295 }
13296 
multi_val_on_domain(isl::space space,isl::multi_val mv)13297 isl::multi_aff multi_aff::multi_val_on_domain(isl::space space, isl::multi_val mv)
13298 {
13299   if (space.is_null() || mv.is_null())
13300     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13301   auto saved_ctx = space.ctx();
13302   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13303   auto res = isl_multi_aff_multi_val_on_domain_space(space.release(), mv.release());
13304   if (!res)
13305     exception::throw_last_error(saved_ctx);
13306   return manage(res);
13307 }
13308 
n_piece()13309 unsigned multi_aff::n_piece() const
13310 {
13311   if (!ptr)
13312     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13313   return isl::pw_multi_aff(*this).n_piece();
13314 }
13315 
neg()13316 isl::multi_aff multi_aff::neg() const
13317 {
13318   if (!ptr)
13319     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13320   auto saved_ctx = ctx();
13321   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13322   auto res = isl_multi_aff_neg(copy());
13323   if (!res)
13324     exception::throw_last_error(saved_ctx);
13325   return manage(res);
13326 }
13327 
plain_is_empty()13328 bool multi_aff::plain_is_empty() const
13329 {
13330   if (!ptr)
13331     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13332   return isl::pw_multi_aff(*this).plain_is_empty();
13333 }
13334 
plain_is_equal(const isl::multi_aff & multi2)13335 bool multi_aff::plain_is_equal(const isl::multi_aff &multi2) const
13336 {
13337   if (!ptr || multi2.is_null())
13338     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13339   auto saved_ctx = ctx();
13340   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13341   auto res = isl_multi_aff_plain_is_equal(get(), multi2.get());
13342   if (res < 0)
13343     exception::throw_last_error(saved_ctx);
13344   return res;
13345 }
13346 
plain_is_equal(const isl::multi_pw_aff & multi2)13347 bool multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
13348 {
13349   if (!ptr)
13350     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13351   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
13352 }
13353 
plain_is_equal(const isl::multi_union_pw_aff & multi2)13354 bool multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
13355 {
13356   if (!ptr)
13357     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13358   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
13359 }
13360 
plain_is_equal(const isl::aff & multi2)13361 bool multi_aff::plain_is_equal(const isl::aff &multi2) const
13362 {
13363   if (!ptr)
13364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13365   return this->plain_is_equal(isl::multi_aff(multi2));
13366 }
13367 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)13368 isl::pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
13369 {
13370   if (!ptr)
13371     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13372   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
13373 }
13374 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)13375 isl::union_pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
13376 {
13377   if (!ptr)
13378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13379   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
13380 }
13381 
product(isl::multi_aff multi2)13382 isl::multi_aff multi_aff::product(isl::multi_aff multi2) const
13383 {
13384   if (!ptr || multi2.is_null())
13385     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13386   auto saved_ctx = ctx();
13387   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13388   auto res = isl_multi_aff_product(copy(), multi2.release());
13389   if (!res)
13390     exception::throw_last_error(saved_ctx);
13391   return manage(res);
13392 }
13393 
product(const isl::multi_pw_aff & multi2)13394 isl::multi_pw_aff multi_aff::product(const isl::multi_pw_aff &multi2) const
13395 {
13396   if (!ptr)
13397     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13398   return isl::pw_multi_aff(*this).product(multi2);
13399 }
13400 
product(const isl::pw_multi_aff & pma2)13401 isl::pw_multi_aff multi_aff::product(const isl::pw_multi_aff &pma2) const
13402 {
13403   if (!ptr)
13404     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13405   return isl::pw_multi_aff(*this).product(pma2);
13406 }
13407 
product(const isl::aff & multi2)13408 isl::multi_aff multi_aff::product(const isl::aff &multi2) const
13409 {
13410   if (!ptr)
13411     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13412   return this->product(isl::multi_aff(multi2));
13413 }
13414 
pullback(isl::multi_aff ma2)13415 isl::multi_aff multi_aff::pullback(isl::multi_aff ma2) const
13416 {
13417   if (!ptr || ma2.is_null())
13418     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13419   auto saved_ctx = ctx();
13420   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13421   auto res = isl_multi_aff_pullback_multi_aff(copy(), ma2.release());
13422   if (!res)
13423     exception::throw_last_error(saved_ctx);
13424   return manage(res);
13425 }
13426 
pullback(const isl::multi_pw_aff & mpa2)13427 isl::multi_pw_aff multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
13428 {
13429   if (!ptr)
13430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13431   return isl::pw_multi_aff(*this).pullback(mpa2);
13432 }
13433 
pullback(const isl::pw_multi_aff & pma2)13434 isl::pw_multi_aff multi_aff::pullback(const isl::pw_multi_aff &pma2) const
13435 {
13436   if (!ptr)
13437     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13438   return isl::pw_multi_aff(*this).pullback(pma2);
13439 }
13440 
pullback(const isl::union_pw_multi_aff & upma2)13441 isl::union_pw_multi_aff multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
13442 {
13443   if (!ptr)
13444     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13445   return isl::pw_multi_aff(*this).pullback(upma2);
13446 }
13447 
pullback(const isl::aff & ma2)13448 isl::multi_aff multi_aff::pullback(const isl::aff &ma2) const
13449 {
13450   if (!ptr)
13451     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13452   return this->pullback(isl::multi_aff(ma2));
13453 }
13454 
pw_multi_aff_list()13455 isl::pw_multi_aff_list multi_aff::pw_multi_aff_list() const
13456 {
13457   if (!ptr)
13458     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13459   return isl::pw_multi_aff(*this).pw_multi_aff_list();
13460 }
13461 
range_factor_domain()13462 isl::pw_multi_aff multi_aff::range_factor_domain() const
13463 {
13464   if (!ptr)
13465     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13466   return isl::pw_multi_aff(*this).range_factor_domain();
13467 }
13468 
range_factor_range()13469 isl::pw_multi_aff multi_aff::range_factor_range() const
13470 {
13471   if (!ptr)
13472     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13473   return isl::pw_multi_aff(*this).range_factor_range();
13474 }
13475 
range_map(isl::space space)13476 isl::multi_aff multi_aff::range_map(isl::space space)
13477 {
13478   if (space.is_null())
13479     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13480   auto saved_ctx = space.ctx();
13481   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13482   auto res = isl_multi_aff_range_map(space.release());
13483   if (!res)
13484     exception::throw_last_error(saved_ctx);
13485   return manage(res);
13486 }
13487 
range_product(isl::multi_aff multi2)13488 isl::multi_aff multi_aff::range_product(isl::multi_aff multi2) const
13489 {
13490   if (!ptr || multi2.is_null())
13491     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13492   auto saved_ctx = ctx();
13493   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13494   auto res = isl_multi_aff_range_product(copy(), multi2.release());
13495   if (!res)
13496     exception::throw_last_error(saved_ctx);
13497   return manage(res);
13498 }
13499 
range_product(const isl::multi_pw_aff & multi2)13500 isl::multi_pw_aff multi_aff::range_product(const isl::multi_pw_aff &multi2) const
13501 {
13502   if (!ptr)
13503     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13504   return isl::pw_multi_aff(*this).range_product(multi2);
13505 }
13506 
range_product(const isl::multi_union_pw_aff & multi2)13507 isl::multi_union_pw_aff multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
13508 {
13509   if (!ptr)
13510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13511   return isl::pw_multi_aff(*this).range_product(multi2);
13512 }
13513 
range_product(const isl::pw_multi_aff & pma2)13514 isl::pw_multi_aff multi_aff::range_product(const isl::pw_multi_aff &pma2) const
13515 {
13516   if (!ptr)
13517     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13518   return isl::pw_multi_aff(*this).range_product(pma2);
13519 }
13520 
range_product(const isl::union_pw_multi_aff & upma2)13521 isl::union_pw_multi_aff multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
13522 {
13523   if (!ptr)
13524     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13525   return isl::pw_multi_aff(*this).range_product(upma2);
13526 }
13527 
range_product(const isl::aff & multi2)13528 isl::multi_aff multi_aff::range_product(const isl::aff &multi2) const
13529 {
13530   if (!ptr)
13531     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13532   return this->range_product(isl::multi_aff(multi2));
13533 }
13534 
range_tuple_id()13535 isl::id multi_aff::range_tuple_id() const
13536 {
13537   if (!ptr)
13538     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13539   auto saved_ctx = ctx();
13540   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13541   auto res = isl_multi_aff_get_range_tuple_id(get());
13542   if (!res)
13543     exception::throw_last_error(saved_ctx);
13544   return manage(res);
13545 }
13546 
get_range_tuple_id()13547 isl::id multi_aff::get_range_tuple_id() const
13548 {
13549   return range_tuple_id();
13550 }
13551 
reset_range_tuple_id()13552 isl::multi_aff multi_aff::reset_range_tuple_id() const
13553 {
13554   if (!ptr)
13555     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13556   auto saved_ctx = ctx();
13557   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13558   auto res = isl_multi_aff_reset_range_tuple_id(copy());
13559   if (!res)
13560     exception::throw_last_error(saved_ctx);
13561   return manage(res);
13562 }
13563 
scale(isl::multi_val mv)13564 isl::multi_aff multi_aff::scale(isl::multi_val mv) const
13565 {
13566   if (!ptr || mv.is_null())
13567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13568   auto saved_ctx = ctx();
13569   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13570   auto res = isl_multi_aff_scale_multi_val(copy(), mv.release());
13571   if (!res)
13572     exception::throw_last_error(saved_ctx);
13573   return manage(res);
13574 }
13575 
scale(isl::val v)13576 isl::multi_aff multi_aff::scale(isl::val v) const
13577 {
13578   if (!ptr || v.is_null())
13579     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13580   auto saved_ctx = ctx();
13581   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13582   auto res = isl_multi_aff_scale_val(copy(), v.release());
13583   if (!res)
13584     exception::throw_last_error(saved_ctx);
13585   return manage(res);
13586 }
13587 
scale(long v)13588 isl::multi_aff multi_aff::scale(long v) const
13589 {
13590   if (!ptr)
13591     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13592   return this->scale(isl::val(ctx(), v));
13593 }
13594 
scale_down(isl::multi_val mv)13595 isl::multi_aff multi_aff::scale_down(isl::multi_val mv) const
13596 {
13597   if (!ptr || mv.is_null())
13598     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13599   auto saved_ctx = ctx();
13600   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13601   auto res = isl_multi_aff_scale_down_multi_val(copy(), mv.release());
13602   if (!res)
13603     exception::throw_last_error(saved_ctx);
13604   return manage(res);
13605 }
13606 
scale_down(isl::val v)13607 isl::multi_aff multi_aff::scale_down(isl::val v) const
13608 {
13609   if (!ptr || v.is_null())
13610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13611   auto saved_ctx = ctx();
13612   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13613   auto res = isl_multi_aff_scale_down_val(copy(), v.release());
13614   if (!res)
13615     exception::throw_last_error(saved_ctx);
13616   return manage(res);
13617 }
13618 
scale_down(long v)13619 isl::multi_aff multi_aff::scale_down(long v) const
13620 {
13621   if (!ptr)
13622     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13623   return this->scale_down(isl::val(ctx(), v));
13624 }
13625 
set_at(int pos,isl::aff el)13626 isl::multi_aff multi_aff::set_at(int pos, isl::aff el) const
13627 {
13628   if (!ptr || el.is_null())
13629     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13630   auto saved_ctx = ctx();
13631   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13632   auto res = isl_multi_aff_set_at(copy(), pos, el.release());
13633   if (!res)
13634     exception::throw_last_error(saved_ctx);
13635   return manage(res);
13636 }
13637 
set_at(int pos,const isl::pw_aff & el)13638 isl::multi_pw_aff multi_aff::set_at(int pos, const isl::pw_aff &el) const
13639 {
13640   if (!ptr)
13641     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13642   return isl::pw_multi_aff(*this).set_at(pos, el);
13643 }
13644 
set_at(int pos,const isl::union_pw_aff & el)13645 isl::multi_union_pw_aff multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
13646 {
13647   if (!ptr)
13648     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13649   return isl::pw_multi_aff(*this).set_at(pos, el);
13650 }
13651 
set_range_tuple(isl::id id)13652 isl::multi_aff multi_aff::set_range_tuple(isl::id id) const
13653 {
13654   if (!ptr || id.is_null())
13655     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13656   auto saved_ctx = ctx();
13657   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13658   auto res = isl_multi_aff_set_range_tuple_id(copy(), id.release());
13659   if (!res)
13660     exception::throw_last_error(saved_ctx);
13661   return manage(res);
13662 }
13663 
set_range_tuple(const std::string & id)13664 isl::multi_aff multi_aff::set_range_tuple(const std::string &id) const
13665 {
13666   if (!ptr)
13667     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13668   return this->set_range_tuple(isl::id(ctx(), id));
13669 }
13670 
size()13671 unsigned multi_aff::size() const
13672 {
13673   if (!ptr)
13674     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13675   auto saved_ctx = ctx();
13676   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13677   auto res = isl_multi_aff_size(get());
13678   if (res < 0)
13679     exception::throw_last_error(saved_ctx);
13680   return res;
13681 }
13682 
space()13683 isl::space multi_aff::space() const
13684 {
13685   if (!ptr)
13686     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13687   auto saved_ctx = ctx();
13688   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13689   auto res = isl_multi_aff_get_space(get());
13690   if (!res)
13691     exception::throw_last_error(saved_ctx);
13692   return manage(res);
13693 }
13694 
get_space()13695 isl::space multi_aff::get_space() const
13696 {
13697   return space();
13698 }
13699 
sub(isl::multi_aff multi2)13700 isl::multi_aff multi_aff::sub(isl::multi_aff multi2) const
13701 {
13702   if (!ptr || multi2.is_null())
13703     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13704   auto saved_ctx = ctx();
13705   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13706   auto res = isl_multi_aff_sub(copy(), multi2.release());
13707   if (!res)
13708     exception::throw_last_error(saved_ctx);
13709   return manage(res);
13710 }
13711 
sub(const isl::multi_pw_aff & multi2)13712 isl::multi_pw_aff multi_aff::sub(const isl::multi_pw_aff &multi2) const
13713 {
13714   if (!ptr)
13715     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13716   return isl::pw_multi_aff(*this).sub(multi2);
13717 }
13718 
sub(const isl::multi_union_pw_aff & multi2)13719 isl::multi_union_pw_aff multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
13720 {
13721   if (!ptr)
13722     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13723   return isl::pw_multi_aff(*this).sub(multi2);
13724 }
13725 
sub(const isl::pw_multi_aff & pma2)13726 isl::pw_multi_aff multi_aff::sub(const isl::pw_multi_aff &pma2) const
13727 {
13728   if (!ptr)
13729     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13730   return isl::pw_multi_aff(*this).sub(pma2);
13731 }
13732 
sub(const isl::union_pw_multi_aff & upma2)13733 isl::union_pw_multi_aff multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
13734 {
13735   if (!ptr)
13736     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13737   return isl::pw_multi_aff(*this).sub(upma2);
13738 }
13739 
sub(const isl::aff & multi2)13740 isl::multi_aff multi_aff::sub(const isl::aff &multi2) const
13741 {
13742   if (!ptr)
13743     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13744   return this->sub(isl::multi_aff(multi2));
13745 }
13746 
subtract_domain(const isl::set & set)13747 isl::pw_multi_aff multi_aff::subtract_domain(const isl::set &set) const
13748 {
13749   if (!ptr)
13750     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13751   return isl::pw_multi_aff(*this).subtract_domain(set);
13752 }
13753 
subtract_domain(const isl::space & space)13754 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::space &space) const
13755 {
13756   if (!ptr)
13757     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13758   return isl::pw_multi_aff(*this).subtract_domain(space);
13759 }
13760 
subtract_domain(const isl::union_set & uset)13761 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::union_set &uset) const
13762 {
13763   if (!ptr)
13764     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13765   return isl::pw_multi_aff(*this).subtract_domain(uset);
13766 }
13767 
to_list()13768 isl::pw_multi_aff_list multi_aff::to_list() const
13769 {
13770   if (!ptr)
13771     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13772   return isl::pw_multi_aff(*this).to_list();
13773 }
13774 
to_multi_pw_aff()13775 isl::multi_pw_aff multi_aff::to_multi_pw_aff() const
13776 {
13777   if (!ptr)
13778     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13779   auto saved_ctx = ctx();
13780   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13781   auto res = isl_multi_aff_to_multi_pw_aff(copy());
13782   if (!res)
13783     exception::throw_last_error(saved_ctx);
13784   return manage(res);
13785 }
13786 
to_multi_union_pw_aff()13787 isl::multi_union_pw_aff multi_aff::to_multi_union_pw_aff() const
13788 {
13789   if (!ptr)
13790     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13791   auto saved_ctx = ctx();
13792   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13793   auto res = isl_multi_aff_to_multi_union_pw_aff(copy());
13794   if (!res)
13795     exception::throw_last_error(saved_ctx);
13796   return manage(res);
13797 }
13798 
to_pw_multi_aff()13799 isl::pw_multi_aff multi_aff::to_pw_multi_aff() const
13800 {
13801   if (!ptr)
13802     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13803   auto saved_ctx = ctx();
13804   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13805   auto res = isl_multi_aff_to_pw_multi_aff(copy());
13806   if (!res)
13807     exception::throw_last_error(saved_ctx);
13808   return manage(res);
13809 }
13810 
to_union_pw_multi_aff()13811 isl::union_pw_multi_aff multi_aff::to_union_pw_multi_aff() const
13812 {
13813   if (!ptr)
13814     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13815   return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
13816 }
13817 
unbind_params_insert_domain(isl::multi_id domain)13818 isl::multi_aff multi_aff::unbind_params_insert_domain(isl::multi_id domain) const
13819 {
13820   if (!ptr || domain.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_multi_aff_unbind_params_insert_domain(copy(), domain.release());
13825   if (!res)
13826     exception::throw_last_error(saved_ctx);
13827   return manage(res);
13828 }
13829 
union_add(const isl::multi_pw_aff & mpa2)13830 isl::multi_pw_aff multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
13831 {
13832   if (!ptr)
13833     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13834   return isl::pw_multi_aff(*this).union_add(mpa2);
13835 }
13836 
union_add(const isl::multi_union_pw_aff & mupa2)13837 isl::multi_union_pw_aff multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
13838 {
13839   if (!ptr)
13840     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13841   return isl::pw_multi_aff(*this).union_add(mupa2);
13842 }
13843 
union_add(const isl::pw_multi_aff & pma2)13844 isl::pw_multi_aff multi_aff::union_add(const isl::pw_multi_aff &pma2) const
13845 {
13846   if (!ptr)
13847     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13848   return isl::pw_multi_aff(*this).union_add(pma2);
13849 }
13850 
union_add(const isl::union_pw_multi_aff & upma2)13851 isl::union_pw_multi_aff multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
13852 {
13853   if (!ptr)
13854     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13855   return isl::pw_multi_aff(*this).union_add(upma2);
13856 }
13857 
zero(isl::space space)13858 isl::multi_aff multi_aff::zero(isl::space space)
13859 {
13860   if (space.is_null())
13861     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13862   auto saved_ctx = space.ctx();
13863   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13864   auto res = isl_multi_aff_zero(space.release());
13865   if (!res)
13866     exception::throw_last_error(saved_ctx);
13867   return manage(res);
13868 }
13869 
13870 inline std::ostream &operator<<(std::ostream &os, const multi_aff &obj)
13871 {
13872   if (!obj.get())
13873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13874   auto saved_ctx = isl_multi_aff_get_ctx(obj.get());
13875   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13876   char *str = isl_multi_aff_to_str(obj.get());
13877   if (!str)
13878     exception::throw_last_error(saved_ctx);
13879   os << str;
13880   free(str);
13881   return os;
13882 }
13883 
13884 // implementations for isl::multi_id
manage(__isl_take isl_multi_id * ptr)13885 multi_id manage(__isl_take isl_multi_id *ptr) {
13886   if (!ptr)
13887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13888   return multi_id(ptr);
13889 }
manage_copy(__isl_keep isl_multi_id * ptr)13890 multi_id manage_copy(__isl_keep isl_multi_id *ptr) {
13891   if (!ptr)
13892     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13893   auto saved_ctx = isl_multi_id_get_ctx(ptr);
13894   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13895   ptr = isl_multi_id_copy(ptr);
13896   if (!ptr)
13897     exception::throw_last_error(saved_ctx);
13898   return multi_id(ptr);
13899 }
13900 
multi_id()13901 multi_id::multi_id()
13902     : ptr(nullptr) {}
13903 
multi_id(const multi_id & obj)13904 multi_id::multi_id(const multi_id &obj)
13905     : ptr(nullptr)
13906 {
13907   if (!obj.ptr)
13908     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13909   auto saved_ctx = isl_multi_id_get_ctx(obj.ptr);
13910   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13911   ptr = obj.copy();
13912   if (!ptr)
13913     exception::throw_last_error(saved_ctx);
13914 }
13915 
multi_id(__isl_take isl_multi_id * ptr)13916 multi_id::multi_id(__isl_take isl_multi_id *ptr)
13917     : ptr(ptr) {}
13918 
multi_id(isl::space space,isl::id_list list)13919 multi_id::multi_id(isl::space space, isl::id_list list)
13920 {
13921   if (space.is_null() || list.is_null())
13922     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13923   auto saved_ctx = space.ctx();
13924   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13925   auto res = isl_multi_id_from_id_list(space.release(), list.release());
13926   if (!res)
13927     exception::throw_last_error(saved_ctx);
13928   ptr = res;
13929 }
13930 
multi_id(isl::ctx ctx,const std::string & str)13931 multi_id::multi_id(isl::ctx ctx, const std::string &str)
13932 {
13933   auto saved_ctx = ctx;
13934   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13935   auto res = isl_multi_id_read_from_str(ctx.release(), str.c_str());
13936   if (!res)
13937     exception::throw_last_error(saved_ctx);
13938   ptr = res;
13939 }
13940 
13941 multi_id &multi_id::operator=(multi_id obj) {
13942   std::swap(this->ptr, obj.ptr);
13943   return *this;
13944 }
13945 
~multi_id()13946 multi_id::~multi_id() {
13947   if (ptr)
13948     isl_multi_id_free(ptr);
13949 }
13950 
copy()13951 __isl_give isl_multi_id *multi_id::copy() const & {
13952   return isl_multi_id_copy(ptr);
13953 }
13954 
get()13955 __isl_keep isl_multi_id *multi_id::get() const {
13956   return ptr;
13957 }
13958 
release()13959 __isl_give isl_multi_id *multi_id::release() {
13960   isl_multi_id *tmp = ptr;
13961   ptr = nullptr;
13962   return tmp;
13963 }
13964 
is_null()13965 bool multi_id::is_null() const {
13966   return ptr == nullptr;
13967 }
13968 
ctx()13969 isl::ctx multi_id::ctx() const {
13970   return isl::ctx(isl_multi_id_get_ctx(ptr));
13971 }
13972 
at(int pos)13973 isl::id multi_id::at(int pos) const
13974 {
13975   if (!ptr)
13976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13977   auto saved_ctx = ctx();
13978   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13979   auto res = isl_multi_id_get_at(get(), pos);
13980   if (!res)
13981     exception::throw_last_error(saved_ctx);
13982   return manage(res);
13983 }
13984 
get_at(int pos)13985 isl::id multi_id::get_at(int pos) const
13986 {
13987   return at(pos);
13988 }
13989 
flat_range_product(isl::multi_id multi2)13990 isl::multi_id multi_id::flat_range_product(isl::multi_id multi2) const
13991 {
13992   if (!ptr || multi2.is_null())
13993     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13994   auto saved_ctx = ctx();
13995   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13996   auto res = isl_multi_id_flat_range_product(copy(), multi2.release());
13997   if (!res)
13998     exception::throw_last_error(saved_ctx);
13999   return manage(res);
14000 }
14001 
list()14002 isl::id_list multi_id::list() const
14003 {
14004   if (!ptr)
14005     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14006   auto saved_ctx = ctx();
14007   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14008   auto res = isl_multi_id_get_list(get());
14009   if (!res)
14010     exception::throw_last_error(saved_ctx);
14011   return manage(res);
14012 }
14013 
get_list()14014 isl::id_list multi_id::get_list() const
14015 {
14016   return list();
14017 }
14018 
plain_is_equal(const isl::multi_id & multi2)14019 bool multi_id::plain_is_equal(const isl::multi_id &multi2) const
14020 {
14021   if (!ptr || multi2.is_null())
14022     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14023   auto saved_ctx = ctx();
14024   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14025   auto res = isl_multi_id_plain_is_equal(get(), multi2.get());
14026   if (res < 0)
14027     exception::throw_last_error(saved_ctx);
14028   return res;
14029 }
14030 
range_product(isl::multi_id multi2)14031 isl::multi_id multi_id::range_product(isl::multi_id multi2) const
14032 {
14033   if (!ptr || multi2.is_null())
14034     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14035   auto saved_ctx = ctx();
14036   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14037   auto res = isl_multi_id_range_product(copy(), multi2.release());
14038   if (!res)
14039     exception::throw_last_error(saved_ctx);
14040   return manage(res);
14041 }
14042 
set_at(int pos,isl::id el)14043 isl::multi_id multi_id::set_at(int pos, isl::id el) const
14044 {
14045   if (!ptr || el.is_null())
14046     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14047   auto saved_ctx = ctx();
14048   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14049   auto res = isl_multi_id_set_at(copy(), pos, el.release());
14050   if (!res)
14051     exception::throw_last_error(saved_ctx);
14052   return manage(res);
14053 }
14054 
set_at(int pos,const std::string & el)14055 isl::multi_id multi_id::set_at(int pos, const std::string &el) const
14056 {
14057   if (!ptr)
14058     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14059   return this->set_at(pos, isl::id(ctx(), el));
14060 }
14061 
size()14062 unsigned multi_id::size() const
14063 {
14064   if (!ptr)
14065     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14066   auto saved_ctx = ctx();
14067   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14068   auto res = isl_multi_id_size(get());
14069   if (res < 0)
14070     exception::throw_last_error(saved_ctx);
14071   return res;
14072 }
14073 
space()14074 isl::space multi_id::space() const
14075 {
14076   if (!ptr)
14077     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14078   auto saved_ctx = ctx();
14079   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14080   auto res = isl_multi_id_get_space(get());
14081   if (!res)
14082     exception::throw_last_error(saved_ctx);
14083   return manage(res);
14084 }
14085 
get_space()14086 isl::space multi_id::get_space() const
14087 {
14088   return space();
14089 }
14090 
14091 inline std::ostream &operator<<(std::ostream &os, const multi_id &obj)
14092 {
14093   if (!obj.get())
14094     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14095   auto saved_ctx = isl_multi_id_get_ctx(obj.get());
14096   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14097   char *str = isl_multi_id_to_str(obj.get());
14098   if (!str)
14099     exception::throw_last_error(saved_ctx);
14100   os << str;
14101   free(str);
14102   return os;
14103 }
14104 
14105 // implementations for isl::multi_pw_aff
manage(__isl_take isl_multi_pw_aff * ptr)14106 multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr) {
14107   if (!ptr)
14108     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14109   return multi_pw_aff(ptr);
14110 }
manage_copy(__isl_keep isl_multi_pw_aff * ptr)14111 multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr) {
14112   if (!ptr)
14113     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14114   auto saved_ctx = isl_multi_pw_aff_get_ctx(ptr);
14115   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14116   ptr = isl_multi_pw_aff_copy(ptr);
14117   if (!ptr)
14118     exception::throw_last_error(saved_ctx);
14119   return multi_pw_aff(ptr);
14120 }
14121 
multi_pw_aff()14122 multi_pw_aff::multi_pw_aff()
14123     : ptr(nullptr) {}
14124 
multi_pw_aff(const multi_pw_aff & obj)14125 multi_pw_aff::multi_pw_aff(const multi_pw_aff &obj)
14126     : ptr(nullptr)
14127 {
14128   if (!obj.ptr)
14129     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14130   auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.ptr);
14131   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14132   ptr = obj.copy();
14133   if (!ptr)
14134     exception::throw_last_error(saved_ctx);
14135 }
14136 
multi_pw_aff(__isl_take isl_multi_pw_aff * ptr)14137 multi_pw_aff::multi_pw_aff(__isl_take isl_multi_pw_aff *ptr)
14138     : ptr(ptr) {}
14139 
multi_pw_aff(isl::aff aff)14140 multi_pw_aff::multi_pw_aff(isl::aff aff)
14141 {
14142   if (aff.is_null())
14143     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14144   auto saved_ctx = aff.ctx();
14145   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14146   auto res = isl_multi_pw_aff_from_aff(aff.release());
14147   if (!res)
14148     exception::throw_last_error(saved_ctx);
14149   ptr = res;
14150 }
14151 
multi_pw_aff(isl::multi_aff ma)14152 multi_pw_aff::multi_pw_aff(isl::multi_aff ma)
14153 {
14154   if (ma.is_null())
14155     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14156   auto saved_ctx = ma.ctx();
14157   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14158   auto res = isl_multi_pw_aff_from_multi_aff(ma.release());
14159   if (!res)
14160     exception::throw_last_error(saved_ctx);
14161   ptr = res;
14162 }
14163 
multi_pw_aff(isl::pw_aff pa)14164 multi_pw_aff::multi_pw_aff(isl::pw_aff pa)
14165 {
14166   if (pa.is_null())
14167     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14168   auto saved_ctx = pa.ctx();
14169   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14170   auto res = isl_multi_pw_aff_from_pw_aff(pa.release());
14171   if (!res)
14172     exception::throw_last_error(saved_ctx);
14173   ptr = res;
14174 }
14175 
multi_pw_aff(isl::space space,isl::pw_aff_list list)14176 multi_pw_aff::multi_pw_aff(isl::space space, isl::pw_aff_list list)
14177 {
14178   if (space.is_null() || list.is_null())
14179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14180   auto saved_ctx = space.ctx();
14181   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14182   auto res = isl_multi_pw_aff_from_pw_aff_list(space.release(), list.release());
14183   if (!res)
14184     exception::throw_last_error(saved_ctx);
14185   ptr = res;
14186 }
14187 
multi_pw_aff(isl::pw_multi_aff pma)14188 multi_pw_aff::multi_pw_aff(isl::pw_multi_aff pma)
14189 {
14190   if (pma.is_null())
14191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14192   auto saved_ctx = pma.ctx();
14193   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14194   auto res = isl_multi_pw_aff_from_pw_multi_aff(pma.release());
14195   if (!res)
14196     exception::throw_last_error(saved_ctx);
14197   ptr = res;
14198 }
14199 
multi_pw_aff(isl::ctx ctx,const std::string & str)14200 multi_pw_aff::multi_pw_aff(isl::ctx ctx, const std::string &str)
14201 {
14202   auto saved_ctx = ctx;
14203   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14204   auto res = isl_multi_pw_aff_read_from_str(ctx.release(), str.c_str());
14205   if (!res)
14206     exception::throw_last_error(saved_ctx);
14207   ptr = res;
14208 }
14209 
14210 multi_pw_aff &multi_pw_aff::operator=(multi_pw_aff obj) {
14211   std::swap(this->ptr, obj.ptr);
14212   return *this;
14213 }
14214 
~multi_pw_aff()14215 multi_pw_aff::~multi_pw_aff() {
14216   if (ptr)
14217     isl_multi_pw_aff_free(ptr);
14218 }
14219 
copy()14220 __isl_give isl_multi_pw_aff *multi_pw_aff::copy() const & {
14221   return isl_multi_pw_aff_copy(ptr);
14222 }
14223 
get()14224 __isl_keep isl_multi_pw_aff *multi_pw_aff::get() const {
14225   return ptr;
14226 }
14227 
release()14228 __isl_give isl_multi_pw_aff *multi_pw_aff::release() {
14229   isl_multi_pw_aff *tmp = ptr;
14230   ptr = nullptr;
14231   return tmp;
14232 }
14233 
is_null()14234 bool multi_pw_aff::is_null() const {
14235   return ptr == nullptr;
14236 }
14237 
ctx()14238 isl::ctx multi_pw_aff::ctx() const {
14239   return isl::ctx(isl_multi_pw_aff_get_ctx(ptr));
14240 }
14241 
add(isl::multi_pw_aff multi2)14242 isl::multi_pw_aff multi_pw_aff::add(isl::multi_pw_aff multi2) const
14243 {
14244   if (!ptr || multi2.is_null())
14245     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14246   auto saved_ctx = ctx();
14247   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14248   auto res = isl_multi_pw_aff_add(copy(), multi2.release());
14249   if (!res)
14250     exception::throw_last_error(saved_ctx);
14251   return manage(res);
14252 }
14253 
add(const isl::multi_union_pw_aff & multi2)14254 isl::multi_union_pw_aff multi_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
14255 {
14256   if (!ptr)
14257     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14258   return isl::multi_union_pw_aff(*this).add(multi2);
14259 }
14260 
add(const isl::aff & multi2)14261 isl::multi_pw_aff multi_pw_aff::add(const isl::aff &multi2) const
14262 {
14263   if (!ptr)
14264     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14265   return this->add(isl::multi_pw_aff(multi2));
14266 }
14267 
add(const isl::multi_aff & multi2)14268 isl::multi_pw_aff multi_pw_aff::add(const isl::multi_aff &multi2) const
14269 {
14270   if (!ptr)
14271     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14272   return this->add(isl::multi_pw_aff(multi2));
14273 }
14274 
add(const isl::pw_aff & multi2)14275 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_aff &multi2) const
14276 {
14277   if (!ptr)
14278     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14279   return this->add(isl::multi_pw_aff(multi2));
14280 }
14281 
add(const isl::pw_multi_aff & multi2)14282 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_multi_aff &multi2) const
14283 {
14284   if (!ptr)
14285     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14286   return this->add(isl::multi_pw_aff(multi2));
14287 }
14288 
add_constant(isl::multi_val mv)14289 isl::multi_pw_aff multi_pw_aff::add_constant(isl::multi_val mv) const
14290 {
14291   if (!ptr || mv.is_null())
14292     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14293   auto saved_ctx = ctx();
14294   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14295   auto res = isl_multi_pw_aff_add_constant_multi_val(copy(), mv.release());
14296   if (!res)
14297     exception::throw_last_error(saved_ctx);
14298   return manage(res);
14299 }
14300 
add_constant(isl::val v)14301 isl::multi_pw_aff multi_pw_aff::add_constant(isl::val v) const
14302 {
14303   if (!ptr || v.is_null())
14304     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14305   auto saved_ctx = ctx();
14306   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14307   auto res = isl_multi_pw_aff_add_constant_val(copy(), v.release());
14308   if (!res)
14309     exception::throw_last_error(saved_ctx);
14310   return manage(res);
14311 }
14312 
add_constant(long v)14313 isl::multi_pw_aff multi_pw_aff::add_constant(long v) const
14314 {
14315   if (!ptr)
14316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14317   return this->add_constant(isl::val(ctx(), v));
14318 }
14319 
as_map()14320 isl::map multi_pw_aff::as_map() const
14321 {
14322   if (!ptr)
14323     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14324   auto saved_ctx = ctx();
14325   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14326   auto res = isl_multi_pw_aff_as_map(copy());
14327   if (!res)
14328     exception::throw_last_error(saved_ctx);
14329   return manage(res);
14330 }
14331 
as_multi_aff()14332 isl::multi_aff multi_pw_aff::as_multi_aff() const
14333 {
14334   if (!ptr)
14335     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14336   auto saved_ctx = ctx();
14337   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14338   auto res = isl_multi_pw_aff_as_multi_aff(copy());
14339   if (!res)
14340     exception::throw_last_error(saved_ctx);
14341   return manage(res);
14342 }
14343 
as_set()14344 isl::set multi_pw_aff::as_set() const
14345 {
14346   if (!ptr)
14347     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14348   auto saved_ctx = ctx();
14349   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14350   auto res = isl_multi_pw_aff_as_set(copy());
14351   if (!res)
14352     exception::throw_last_error(saved_ctx);
14353   return manage(res);
14354 }
14355 
at(int pos)14356 isl::pw_aff multi_pw_aff::at(int pos) const
14357 {
14358   if (!ptr)
14359     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14360   auto saved_ctx = ctx();
14361   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14362   auto res = isl_multi_pw_aff_get_at(get(), pos);
14363   if (!res)
14364     exception::throw_last_error(saved_ctx);
14365   return manage(res);
14366 }
14367 
get_at(int pos)14368 isl::pw_aff multi_pw_aff::get_at(int pos) const
14369 {
14370   return at(pos);
14371 }
14372 
bind(isl::multi_id tuple)14373 isl::set multi_pw_aff::bind(isl::multi_id tuple) const
14374 {
14375   if (!ptr || tuple.is_null())
14376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14377   auto saved_ctx = ctx();
14378   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14379   auto res = isl_multi_pw_aff_bind(copy(), tuple.release());
14380   if (!res)
14381     exception::throw_last_error(saved_ctx);
14382   return manage(res);
14383 }
14384 
bind_domain(isl::multi_id tuple)14385 isl::multi_pw_aff multi_pw_aff::bind_domain(isl::multi_id tuple) const
14386 {
14387   if (!ptr || tuple.is_null())
14388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14389   auto saved_ctx = ctx();
14390   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14391   auto res = isl_multi_pw_aff_bind_domain(copy(), tuple.release());
14392   if (!res)
14393     exception::throw_last_error(saved_ctx);
14394   return manage(res);
14395 }
14396 
bind_domain_wrapped_domain(isl::multi_id tuple)14397 isl::multi_pw_aff multi_pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
14398 {
14399   if (!ptr || tuple.is_null())
14400     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14401   auto saved_ctx = ctx();
14402   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14403   auto res = isl_multi_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
14404   if (!res)
14405     exception::throw_last_error(saved_ctx);
14406   return manage(res);
14407 }
14408 
coalesce()14409 isl::multi_pw_aff multi_pw_aff::coalesce() const
14410 {
14411   if (!ptr)
14412     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14413   auto saved_ctx = ctx();
14414   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14415   auto res = isl_multi_pw_aff_coalesce(copy());
14416   if (!res)
14417     exception::throw_last_error(saved_ctx);
14418   return manage(res);
14419 }
14420 
domain()14421 isl::set multi_pw_aff::domain() const
14422 {
14423   if (!ptr)
14424     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14425   auto saved_ctx = ctx();
14426   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14427   auto res = isl_multi_pw_aff_domain(copy());
14428   if (!res)
14429     exception::throw_last_error(saved_ctx);
14430   return manage(res);
14431 }
14432 
flat_range_product(isl::multi_pw_aff multi2)14433 isl::multi_pw_aff multi_pw_aff::flat_range_product(isl::multi_pw_aff multi2) const
14434 {
14435   if (!ptr || multi2.is_null())
14436     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14437   auto saved_ctx = ctx();
14438   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14439   auto res = isl_multi_pw_aff_flat_range_product(copy(), multi2.release());
14440   if (!res)
14441     exception::throw_last_error(saved_ctx);
14442   return manage(res);
14443 }
14444 
flat_range_product(const isl::multi_union_pw_aff & multi2)14445 isl::multi_union_pw_aff multi_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
14446 {
14447   if (!ptr)
14448     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14449   return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
14450 }
14451 
flat_range_product(const isl::aff & multi2)14452 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::aff &multi2) const
14453 {
14454   if (!ptr)
14455     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14456   return this->flat_range_product(isl::multi_pw_aff(multi2));
14457 }
14458 
flat_range_product(const isl::multi_aff & multi2)14459 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::multi_aff &multi2) const
14460 {
14461   if (!ptr)
14462     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14463   return this->flat_range_product(isl::multi_pw_aff(multi2));
14464 }
14465 
flat_range_product(const isl::pw_aff & multi2)14466 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_aff &multi2) const
14467 {
14468   if (!ptr)
14469     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14470   return this->flat_range_product(isl::multi_pw_aff(multi2));
14471 }
14472 
flat_range_product(const isl::pw_multi_aff & multi2)14473 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_multi_aff &multi2) const
14474 {
14475   if (!ptr)
14476     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14477   return this->flat_range_product(isl::multi_pw_aff(multi2));
14478 }
14479 
gist(isl::set set)14480 isl::multi_pw_aff multi_pw_aff::gist(isl::set set) const
14481 {
14482   if (!ptr || set.is_null())
14483     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14484   auto saved_ctx = ctx();
14485   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14486   auto res = isl_multi_pw_aff_gist(copy(), set.release());
14487   if (!res)
14488     exception::throw_last_error(saved_ctx);
14489   return manage(res);
14490 }
14491 
gist(const isl::union_set & context)14492 isl::multi_union_pw_aff multi_pw_aff::gist(const isl::union_set &context) const
14493 {
14494   if (!ptr)
14495     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14496   return isl::multi_union_pw_aff(*this).gist(context);
14497 }
14498 
gist(const isl::basic_set & set)14499 isl::multi_pw_aff multi_pw_aff::gist(const isl::basic_set &set) const
14500 {
14501   if (!ptr)
14502     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14503   return this->gist(isl::set(set));
14504 }
14505 
gist(const isl::point & set)14506 isl::multi_pw_aff multi_pw_aff::gist(const isl::point &set) const
14507 {
14508   if (!ptr)
14509     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14510   return this->gist(isl::set(set));
14511 }
14512 
has_range_tuple_id()14513 bool multi_pw_aff::has_range_tuple_id() const
14514 {
14515   if (!ptr)
14516     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14517   auto saved_ctx = ctx();
14518   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14519   auto res = isl_multi_pw_aff_has_range_tuple_id(get());
14520   if (res < 0)
14521     exception::throw_last_error(saved_ctx);
14522   return res;
14523 }
14524 
identity()14525 isl::multi_pw_aff multi_pw_aff::identity() const
14526 {
14527   if (!ptr)
14528     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14529   auto saved_ctx = ctx();
14530   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14531   auto res = isl_multi_pw_aff_identity_multi_pw_aff(copy());
14532   if (!res)
14533     exception::throw_last_error(saved_ctx);
14534   return manage(res);
14535 }
14536 
identity_on_domain(isl::space space)14537 isl::multi_pw_aff multi_pw_aff::identity_on_domain(isl::space space)
14538 {
14539   if (space.is_null())
14540     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14541   auto saved_ctx = space.ctx();
14542   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14543   auto res = isl_multi_pw_aff_identity_on_domain_space(space.release());
14544   if (!res)
14545     exception::throw_last_error(saved_ctx);
14546   return manage(res);
14547 }
14548 
insert_domain(isl::space domain)14549 isl::multi_pw_aff multi_pw_aff::insert_domain(isl::space domain) const
14550 {
14551   if (!ptr || domain.is_null())
14552     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14553   auto saved_ctx = ctx();
14554   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14555   auto res = isl_multi_pw_aff_insert_domain(copy(), domain.release());
14556   if (!res)
14557     exception::throw_last_error(saved_ctx);
14558   return manage(res);
14559 }
14560 
intersect_domain(isl::set domain)14561 isl::multi_pw_aff multi_pw_aff::intersect_domain(isl::set domain) const
14562 {
14563   if (!ptr || domain.is_null())
14564     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14565   auto saved_ctx = ctx();
14566   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14567   auto res = isl_multi_pw_aff_intersect_domain(copy(), domain.release());
14568   if (!res)
14569     exception::throw_last_error(saved_ctx);
14570   return manage(res);
14571 }
14572 
intersect_domain(const isl::union_set & uset)14573 isl::multi_union_pw_aff multi_pw_aff::intersect_domain(const isl::union_set &uset) const
14574 {
14575   if (!ptr)
14576     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14577   return isl::multi_union_pw_aff(*this).intersect_domain(uset);
14578 }
14579 
intersect_domain(const isl::basic_set & domain)14580 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::basic_set &domain) const
14581 {
14582   if (!ptr)
14583     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14584   return this->intersect_domain(isl::set(domain));
14585 }
14586 
intersect_domain(const isl::point & domain)14587 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::point &domain) const
14588 {
14589   if (!ptr)
14590     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14591   return this->intersect_domain(isl::set(domain));
14592 }
14593 
intersect_params(isl::set set)14594 isl::multi_pw_aff multi_pw_aff::intersect_params(isl::set set) const
14595 {
14596   if (!ptr || set.is_null())
14597     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14598   auto saved_ctx = ctx();
14599   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14600   auto res = isl_multi_pw_aff_intersect_params(copy(), set.release());
14601   if (!res)
14602     exception::throw_last_error(saved_ctx);
14603   return manage(res);
14604 }
14605 
involves_nan()14606 bool multi_pw_aff::involves_nan() const
14607 {
14608   if (!ptr)
14609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14610   auto saved_ctx = ctx();
14611   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14612   auto res = isl_multi_pw_aff_involves_nan(get());
14613   if (res < 0)
14614     exception::throw_last_error(saved_ctx);
14615   return res;
14616 }
14617 
involves_param(const isl::id & id)14618 bool multi_pw_aff::involves_param(const isl::id &id) const
14619 {
14620   if (!ptr || id.is_null())
14621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14622   auto saved_ctx = ctx();
14623   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14624   auto res = isl_multi_pw_aff_involves_param_id(get(), id.get());
14625   if (res < 0)
14626     exception::throw_last_error(saved_ctx);
14627   return res;
14628 }
14629 
involves_param(const std::string & id)14630 bool multi_pw_aff::involves_param(const std::string &id) const
14631 {
14632   if (!ptr)
14633     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14634   return this->involves_param(isl::id(ctx(), id));
14635 }
14636 
involves_param(const isl::id_list & list)14637 bool multi_pw_aff::involves_param(const isl::id_list &list) const
14638 {
14639   if (!ptr || list.is_null())
14640     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14641   auto saved_ctx = ctx();
14642   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14643   auto res = isl_multi_pw_aff_involves_param_id_list(get(), list.get());
14644   if (res < 0)
14645     exception::throw_last_error(saved_ctx);
14646   return res;
14647 }
14648 
isa_multi_aff()14649 bool multi_pw_aff::isa_multi_aff() const
14650 {
14651   if (!ptr)
14652     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14653   auto saved_ctx = ctx();
14654   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14655   auto res = isl_multi_pw_aff_isa_multi_aff(get());
14656   if (res < 0)
14657     exception::throw_last_error(saved_ctx);
14658   return res;
14659 }
14660 
list()14661 isl::pw_aff_list multi_pw_aff::list() const
14662 {
14663   if (!ptr)
14664     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14665   auto saved_ctx = ctx();
14666   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14667   auto res = isl_multi_pw_aff_get_list(get());
14668   if (!res)
14669     exception::throw_last_error(saved_ctx);
14670   return manage(res);
14671 }
14672 
get_list()14673 isl::pw_aff_list multi_pw_aff::get_list() const
14674 {
14675   return list();
14676 }
14677 
max(isl::multi_pw_aff multi2)14678 isl::multi_pw_aff multi_pw_aff::max(isl::multi_pw_aff multi2) const
14679 {
14680   if (!ptr || multi2.is_null())
14681     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14682   auto saved_ctx = ctx();
14683   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14684   auto res = isl_multi_pw_aff_max(copy(), multi2.release());
14685   if (!res)
14686     exception::throw_last_error(saved_ctx);
14687   return manage(res);
14688 }
14689 
max_multi_val()14690 isl::multi_val multi_pw_aff::max_multi_val() const
14691 {
14692   if (!ptr)
14693     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14694   auto saved_ctx = ctx();
14695   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14696   auto res = isl_multi_pw_aff_max_multi_val(copy());
14697   if (!res)
14698     exception::throw_last_error(saved_ctx);
14699   return manage(res);
14700 }
14701 
min(isl::multi_pw_aff multi2)14702 isl::multi_pw_aff multi_pw_aff::min(isl::multi_pw_aff multi2) const
14703 {
14704   if (!ptr || multi2.is_null())
14705     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14706   auto saved_ctx = ctx();
14707   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14708   auto res = isl_multi_pw_aff_min(copy(), multi2.release());
14709   if (!res)
14710     exception::throw_last_error(saved_ctx);
14711   return manage(res);
14712 }
14713 
min_multi_val()14714 isl::multi_val multi_pw_aff::min_multi_val() const
14715 {
14716   if (!ptr)
14717     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14718   auto saved_ctx = ctx();
14719   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14720   auto res = isl_multi_pw_aff_min_multi_val(copy());
14721   if (!res)
14722     exception::throw_last_error(saved_ctx);
14723   return manage(res);
14724 }
14725 
neg()14726 isl::multi_pw_aff multi_pw_aff::neg() const
14727 {
14728   if (!ptr)
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_pw_aff_neg(copy());
14733   if (!res)
14734     exception::throw_last_error(saved_ctx);
14735   return manage(res);
14736 }
14737 
plain_is_equal(const isl::multi_pw_aff & multi2)14738 bool multi_pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
14739 {
14740   if (!ptr || multi2.is_null())
14741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14742   auto saved_ctx = ctx();
14743   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14744   auto res = isl_multi_pw_aff_plain_is_equal(get(), multi2.get());
14745   if (res < 0)
14746     exception::throw_last_error(saved_ctx);
14747   return res;
14748 }
14749 
plain_is_equal(const isl::multi_union_pw_aff & multi2)14750 bool multi_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
14751 {
14752   if (!ptr)
14753     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14754   return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
14755 }
14756 
plain_is_equal(const isl::aff & multi2)14757 bool multi_pw_aff::plain_is_equal(const isl::aff &multi2) const
14758 {
14759   if (!ptr)
14760     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14761   return this->plain_is_equal(isl::multi_pw_aff(multi2));
14762 }
14763 
plain_is_equal(const isl::multi_aff & multi2)14764 bool multi_pw_aff::plain_is_equal(const isl::multi_aff &multi2) const
14765 {
14766   if (!ptr)
14767     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14768   return this->plain_is_equal(isl::multi_pw_aff(multi2));
14769 }
14770 
plain_is_equal(const isl::pw_aff & multi2)14771 bool multi_pw_aff::plain_is_equal(const isl::pw_aff &multi2) const
14772 {
14773   if (!ptr)
14774     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14775   return this->plain_is_equal(isl::multi_pw_aff(multi2));
14776 }
14777 
plain_is_equal(const isl::pw_multi_aff & multi2)14778 bool multi_pw_aff::plain_is_equal(const isl::pw_multi_aff &multi2) const
14779 {
14780   if (!ptr)
14781     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14782   return this->plain_is_equal(isl::multi_pw_aff(multi2));
14783 }
14784 
product(isl::multi_pw_aff multi2)14785 isl::multi_pw_aff multi_pw_aff::product(isl::multi_pw_aff multi2) const
14786 {
14787   if (!ptr || multi2.is_null())
14788     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14789   auto saved_ctx = ctx();
14790   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14791   auto res = isl_multi_pw_aff_product(copy(), multi2.release());
14792   if (!res)
14793     exception::throw_last_error(saved_ctx);
14794   return manage(res);
14795 }
14796 
pullback(isl::multi_aff ma)14797 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_aff ma) const
14798 {
14799   if (!ptr || ma.is_null())
14800     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14801   auto saved_ctx = ctx();
14802   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14803   auto res = isl_multi_pw_aff_pullback_multi_aff(copy(), ma.release());
14804   if (!res)
14805     exception::throw_last_error(saved_ctx);
14806   return manage(res);
14807 }
14808 
pullback(isl::multi_pw_aff mpa2)14809 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_pw_aff mpa2) const
14810 {
14811   if (!ptr || mpa2.is_null())
14812     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14813   auto saved_ctx = ctx();
14814   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14815   auto res = isl_multi_pw_aff_pullback_multi_pw_aff(copy(), mpa2.release());
14816   if (!res)
14817     exception::throw_last_error(saved_ctx);
14818   return manage(res);
14819 }
14820 
pullback(isl::pw_multi_aff pma)14821 isl::multi_pw_aff multi_pw_aff::pullback(isl::pw_multi_aff pma) const
14822 {
14823   if (!ptr || pma.is_null())
14824     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14825   auto saved_ctx = ctx();
14826   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14827   auto res = isl_multi_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
14828   if (!res)
14829     exception::throw_last_error(saved_ctx);
14830   return manage(res);
14831 }
14832 
pullback(const isl::union_pw_multi_aff & upma)14833 isl::multi_union_pw_aff multi_pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
14834 {
14835   if (!ptr)
14836     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14837   return isl::multi_union_pw_aff(*this).pullback(upma);
14838 }
14839 
range_product(isl::multi_pw_aff multi2)14840 isl::multi_pw_aff multi_pw_aff::range_product(isl::multi_pw_aff multi2) const
14841 {
14842   if (!ptr || multi2.is_null())
14843     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14844   auto saved_ctx = ctx();
14845   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14846   auto res = isl_multi_pw_aff_range_product(copy(), multi2.release());
14847   if (!res)
14848     exception::throw_last_error(saved_ctx);
14849   return manage(res);
14850 }
14851 
range_product(const isl::multi_union_pw_aff & multi2)14852 isl::multi_union_pw_aff multi_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
14853 {
14854   if (!ptr)
14855     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14856   return isl::multi_union_pw_aff(*this).range_product(multi2);
14857 }
14858 
range_product(const isl::aff & multi2)14859 isl::multi_pw_aff multi_pw_aff::range_product(const isl::aff &multi2) const
14860 {
14861   if (!ptr)
14862     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14863   return this->range_product(isl::multi_pw_aff(multi2));
14864 }
14865 
range_product(const isl::multi_aff & multi2)14866 isl::multi_pw_aff multi_pw_aff::range_product(const isl::multi_aff &multi2) const
14867 {
14868   if (!ptr)
14869     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14870   return this->range_product(isl::multi_pw_aff(multi2));
14871 }
14872 
range_product(const isl::pw_aff & multi2)14873 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_aff &multi2) const
14874 {
14875   if (!ptr)
14876     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14877   return this->range_product(isl::multi_pw_aff(multi2));
14878 }
14879 
range_product(const isl::pw_multi_aff & multi2)14880 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_multi_aff &multi2) const
14881 {
14882   if (!ptr)
14883     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14884   return this->range_product(isl::multi_pw_aff(multi2));
14885 }
14886 
range_tuple_id()14887 isl::id multi_pw_aff::range_tuple_id() const
14888 {
14889   if (!ptr)
14890     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14891   auto saved_ctx = ctx();
14892   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14893   auto res = isl_multi_pw_aff_get_range_tuple_id(get());
14894   if (!res)
14895     exception::throw_last_error(saved_ctx);
14896   return manage(res);
14897 }
14898 
get_range_tuple_id()14899 isl::id multi_pw_aff::get_range_tuple_id() const
14900 {
14901   return range_tuple_id();
14902 }
14903 
reset_range_tuple_id()14904 isl::multi_pw_aff multi_pw_aff::reset_range_tuple_id() const
14905 {
14906   if (!ptr)
14907     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14908   auto saved_ctx = ctx();
14909   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14910   auto res = isl_multi_pw_aff_reset_range_tuple_id(copy());
14911   if (!res)
14912     exception::throw_last_error(saved_ctx);
14913   return manage(res);
14914 }
14915 
scale(isl::multi_val mv)14916 isl::multi_pw_aff multi_pw_aff::scale(isl::multi_val mv) const
14917 {
14918   if (!ptr || mv.is_null())
14919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14920   auto saved_ctx = ctx();
14921   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14922   auto res = isl_multi_pw_aff_scale_multi_val(copy(), mv.release());
14923   if (!res)
14924     exception::throw_last_error(saved_ctx);
14925   return manage(res);
14926 }
14927 
scale(isl::val v)14928 isl::multi_pw_aff multi_pw_aff::scale(isl::val v) const
14929 {
14930   if (!ptr || v.is_null())
14931     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14932   auto saved_ctx = ctx();
14933   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14934   auto res = isl_multi_pw_aff_scale_val(copy(), v.release());
14935   if (!res)
14936     exception::throw_last_error(saved_ctx);
14937   return manage(res);
14938 }
14939 
scale(long v)14940 isl::multi_pw_aff multi_pw_aff::scale(long v) const
14941 {
14942   if (!ptr)
14943     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14944   return this->scale(isl::val(ctx(), v));
14945 }
14946 
scale_down(isl::multi_val mv)14947 isl::multi_pw_aff multi_pw_aff::scale_down(isl::multi_val mv) const
14948 {
14949   if (!ptr || mv.is_null())
14950     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14951   auto saved_ctx = ctx();
14952   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14953   auto res = isl_multi_pw_aff_scale_down_multi_val(copy(), mv.release());
14954   if (!res)
14955     exception::throw_last_error(saved_ctx);
14956   return manage(res);
14957 }
14958 
scale_down(isl::val v)14959 isl::multi_pw_aff multi_pw_aff::scale_down(isl::val v) const
14960 {
14961   if (!ptr || v.is_null())
14962     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14963   auto saved_ctx = ctx();
14964   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14965   auto res = isl_multi_pw_aff_scale_down_val(copy(), v.release());
14966   if (!res)
14967     exception::throw_last_error(saved_ctx);
14968   return manage(res);
14969 }
14970 
scale_down(long v)14971 isl::multi_pw_aff multi_pw_aff::scale_down(long v) const
14972 {
14973   if (!ptr)
14974     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14975   return this->scale_down(isl::val(ctx(), v));
14976 }
14977 
set_at(int pos,isl::pw_aff el)14978 isl::multi_pw_aff multi_pw_aff::set_at(int pos, isl::pw_aff el) const
14979 {
14980   if (!ptr || el.is_null())
14981     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14982   auto saved_ctx = ctx();
14983   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14984   auto res = isl_multi_pw_aff_set_at(copy(), pos, el.release());
14985   if (!res)
14986     exception::throw_last_error(saved_ctx);
14987   return manage(res);
14988 }
14989 
set_at(int pos,const isl::union_pw_aff & el)14990 isl::multi_union_pw_aff multi_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
14991 {
14992   if (!ptr)
14993     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14994   return isl::multi_union_pw_aff(*this).set_at(pos, el);
14995 }
14996 
set_range_tuple(isl::id id)14997 isl::multi_pw_aff multi_pw_aff::set_range_tuple(isl::id id) const
14998 {
14999   if (!ptr || id.is_null())
15000     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15001   auto saved_ctx = ctx();
15002   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15003   auto res = isl_multi_pw_aff_set_range_tuple_id(copy(), id.release());
15004   if (!res)
15005     exception::throw_last_error(saved_ctx);
15006   return manage(res);
15007 }
15008 
set_range_tuple(const std::string & id)15009 isl::multi_pw_aff multi_pw_aff::set_range_tuple(const std::string &id) const
15010 {
15011   if (!ptr)
15012     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15013   return this->set_range_tuple(isl::id(ctx(), id));
15014 }
15015 
size()15016 unsigned multi_pw_aff::size() const
15017 {
15018   if (!ptr)
15019     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15020   auto saved_ctx = ctx();
15021   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15022   auto res = isl_multi_pw_aff_size(get());
15023   if (res < 0)
15024     exception::throw_last_error(saved_ctx);
15025   return res;
15026 }
15027 
space()15028 isl::space multi_pw_aff::space() const
15029 {
15030   if (!ptr)
15031     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15032   auto saved_ctx = ctx();
15033   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15034   auto res = isl_multi_pw_aff_get_space(get());
15035   if (!res)
15036     exception::throw_last_error(saved_ctx);
15037   return manage(res);
15038 }
15039 
get_space()15040 isl::space multi_pw_aff::get_space() const
15041 {
15042   return space();
15043 }
15044 
sub(isl::multi_pw_aff multi2)15045 isl::multi_pw_aff multi_pw_aff::sub(isl::multi_pw_aff multi2) const
15046 {
15047   if (!ptr || multi2.is_null())
15048     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15049   auto saved_ctx = ctx();
15050   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15051   auto res = isl_multi_pw_aff_sub(copy(), multi2.release());
15052   if (!res)
15053     exception::throw_last_error(saved_ctx);
15054   return manage(res);
15055 }
15056 
sub(const isl::multi_union_pw_aff & multi2)15057 isl::multi_union_pw_aff multi_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
15058 {
15059   if (!ptr)
15060     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15061   return isl::multi_union_pw_aff(*this).sub(multi2);
15062 }
15063 
sub(const isl::aff & multi2)15064 isl::multi_pw_aff multi_pw_aff::sub(const isl::aff &multi2) const
15065 {
15066   if (!ptr)
15067     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15068   return this->sub(isl::multi_pw_aff(multi2));
15069 }
15070 
sub(const isl::multi_aff & multi2)15071 isl::multi_pw_aff multi_pw_aff::sub(const isl::multi_aff &multi2) const
15072 {
15073   if (!ptr)
15074     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15075   return this->sub(isl::multi_pw_aff(multi2));
15076 }
15077 
sub(const isl::pw_aff & multi2)15078 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_aff &multi2) const
15079 {
15080   if (!ptr)
15081     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15082   return this->sub(isl::multi_pw_aff(multi2));
15083 }
15084 
sub(const isl::pw_multi_aff & multi2)15085 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_multi_aff &multi2) const
15086 {
15087   if (!ptr)
15088     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15089   return this->sub(isl::multi_pw_aff(multi2));
15090 }
15091 
unbind_params_insert_domain(isl::multi_id domain)15092 isl::multi_pw_aff multi_pw_aff::unbind_params_insert_domain(isl::multi_id domain) const
15093 {
15094   if (!ptr || domain.is_null())
15095     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15096   auto saved_ctx = ctx();
15097   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15098   auto res = isl_multi_pw_aff_unbind_params_insert_domain(copy(), domain.release());
15099   if (!res)
15100     exception::throw_last_error(saved_ctx);
15101   return manage(res);
15102 }
15103 
union_add(isl::multi_pw_aff mpa2)15104 isl::multi_pw_aff multi_pw_aff::union_add(isl::multi_pw_aff mpa2) const
15105 {
15106   if (!ptr || mpa2.is_null())
15107     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15108   auto saved_ctx = ctx();
15109   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15110   auto res = isl_multi_pw_aff_union_add(copy(), mpa2.release());
15111   if (!res)
15112     exception::throw_last_error(saved_ctx);
15113   return manage(res);
15114 }
15115 
union_add(const isl::multi_union_pw_aff & mupa2)15116 isl::multi_union_pw_aff multi_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
15117 {
15118   if (!ptr)
15119     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15120   return isl::multi_union_pw_aff(*this).union_add(mupa2);
15121 }
15122 
union_add(const isl::aff & mpa2)15123 isl::multi_pw_aff multi_pw_aff::union_add(const isl::aff &mpa2) const
15124 {
15125   if (!ptr)
15126     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15127   return this->union_add(isl::multi_pw_aff(mpa2));
15128 }
15129 
union_add(const isl::multi_aff & mpa2)15130 isl::multi_pw_aff multi_pw_aff::union_add(const isl::multi_aff &mpa2) const
15131 {
15132   if (!ptr)
15133     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15134   return this->union_add(isl::multi_pw_aff(mpa2));
15135 }
15136 
union_add(const isl::pw_aff & mpa2)15137 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_aff &mpa2) const
15138 {
15139   if (!ptr)
15140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15141   return this->union_add(isl::multi_pw_aff(mpa2));
15142 }
15143 
union_add(const isl::pw_multi_aff & mpa2)15144 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_multi_aff &mpa2) const
15145 {
15146   if (!ptr)
15147     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15148   return this->union_add(isl::multi_pw_aff(mpa2));
15149 }
15150 
zero(isl::space space)15151 isl::multi_pw_aff multi_pw_aff::zero(isl::space space)
15152 {
15153   if (space.is_null())
15154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15155   auto saved_ctx = space.ctx();
15156   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15157   auto res = isl_multi_pw_aff_zero(space.release());
15158   if (!res)
15159     exception::throw_last_error(saved_ctx);
15160   return manage(res);
15161 }
15162 
15163 inline std::ostream &operator<<(std::ostream &os, const multi_pw_aff &obj)
15164 {
15165   if (!obj.get())
15166     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15167   auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.get());
15168   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15169   char *str = isl_multi_pw_aff_to_str(obj.get());
15170   if (!str)
15171     exception::throw_last_error(saved_ctx);
15172   os << str;
15173   free(str);
15174   return os;
15175 }
15176 
15177 // implementations for isl::multi_union_pw_aff
manage(__isl_take isl_multi_union_pw_aff * ptr)15178 multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr) {
15179   if (!ptr)
15180     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15181   return multi_union_pw_aff(ptr);
15182 }
manage_copy(__isl_keep isl_multi_union_pw_aff * ptr)15183 multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr) {
15184   if (!ptr)
15185     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15186   auto saved_ctx = isl_multi_union_pw_aff_get_ctx(ptr);
15187   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15188   ptr = isl_multi_union_pw_aff_copy(ptr);
15189   if (!ptr)
15190     exception::throw_last_error(saved_ctx);
15191   return multi_union_pw_aff(ptr);
15192 }
15193 
multi_union_pw_aff()15194 multi_union_pw_aff::multi_union_pw_aff()
15195     : ptr(nullptr) {}
15196 
multi_union_pw_aff(const multi_union_pw_aff & obj)15197 multi_union_pw_aff::multi_union_pw_aff(const multi_union_pw_aff &obj)
15198     : ptr(nullptr)
15199 {
15200   if (!obj.ptr)
15201     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15202   auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.ptr);
15203   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15204   ptr = obj.copy();
15205   if (!ptr)
15206     exception::throw_last_error(saved_ctx);
15207 }
15208 
multi_union_pw_aff(__isl_take isl_multi_union_pw_aff * ptr)15209 multi_union_pw_aff::multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr)
15210     : ptr(ptr) {}
15211 
multi_union_pw_aff(isl::multi_pw_aff mpa)15212 multi_union_pw_aff::multi_union_pw_aff(isl::multi_pw_aff mpa)
15213 {
15214   if (mpa.is_null())
15215     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15216   auto saved_ctx = mpa.ctx();
15217   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15218   auto res = isl_multi_union_pw_aff_from_multi_pw_aff(mpa.release());
15219   if (!res)
15220     exception::throw_last_error(saved_ctx);
15221   ptr = res;
15222 }
15223 
multi_union_pw_aff(isl::union_pw_aff upa)15224 multi_union_pw_aff::multi_union_pw_aff(isl::union_pw_aff upa)
15225 {
15226   if (upa.is_null())
15227     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15228   auto saved_ctx = upa.ctx();
15229   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15230   auto res = isl_multi_union_pw_aff_from_union_pw_aff(upa.release());
15231   if (!res)
15232     exception::throw_last_error(saved_ctx);
15233   ptr = res;
15234 }
15235 
multi_union_pw_aff(isl::space space,isl::union_pw_aff_list list)15236 multi_union_pw_aff::multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list)
15237 {
15238   if (space.is_null() || list.is_null())
15239     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15240   auto saved_ctx = space.ctx();
15241   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15242   auto res = isl_multi_union_pw_aff_from_union_pw_aff_list(space.release(), list.release());
15243   if (!res)
15244     exception::throw_last_error(saved_ctx);
15245   ptr = res;
15246 }
15247 
multi_union_pw_aff(isl::ctx ctx,const std::string & str)15248 multi_union_pw_aff::multi_union_pw_aff(isl::ctx ctx, const std::string &str)
15249 {
15250   auto saved_ctx = ctx;
15251   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15252   auto res = isl_multi_union_pw_aff_read_from_str(ctx.release(), str.c_str());
15253   if (!res)
15254     exception::throw_last_error(saved_ctx);
15255   ptr = res;
15256 }
15257 
15258 multi_union_pw_aff &multi_union_pw_aff::operator=(multi_union_pw_aff obj) {
15259   std::swap(this->ptr, obj.ptr);
15260   return *this;
15261 }
15262 
~multi_union_pw_aff()15263 multi_union_pw_aff::~multi_union_pw_aff() {
15264   if (ptr)
15265     isl_multi_union_pw_aff_free(ptr);
15266 }
15267 
copy()15268 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::copy() const & {
15269   return isl_multi_union_pw_aff_copy(ptr);
15270 }
15271 
get()15272 __isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::get() const {
15273   return ptr;
15274 }
15275 
release()15276 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::release() {
15277   isl_multi_union_pw_aff *tmp = ptr;
15278   ptr = nullptr;
15279   return tmp;
15280 }
15281 
is_null()15282 bool multi_union_pw_aff::is_null() const {
15283   return ptr == nullptr;
15284 }
15285 
ctx()15286 isl::ctx multi_union_pw_aff::ctx() const {
15287   return isl::ctx(isl_multi_union_pw_aff_get_ctx(ptr));
15288 }
15289 
add(isl::multi_union_pw_aff multi2)15290 isl::multi_union_pw_aff multi_union_pw_aff::add(isl::multi_union_pw_aff multi2) const
15291 {
15292   if (!ptr || multi2.is_null())
15293     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15294   auto saved_ctx = ctx();
15295   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15296   auto res = isl_multi_union_pw_aff_add(copy(), multi2.release());
15297   if (!res)
15298     exception::throw_last_error(saved_ctx);
15299   return manage(res);
15300 }
15301 
at(int pos)15302 isl::union_pw_aff multi_union_pw_aff::at(int pos) const
15303 {
15304   if (!ptr)
15305     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15306   auto saved_ctx = ctx();
15307   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15308   auto res = isl_multi_union_pw_aff_get_at(get(), pos);
15309   if (!res)
15310     exception::throw_last_error(saved_ctx);
15311   return manage(res);
15312 }
15313 
get_at(int pos)15314 isl::union_pw_aff multi_union_pw_aff::get_at(int pos) const
15315 {
15316   return at(pos);
15317 }
15318 
bind(isl::multi_id tuple)15319 isl::union_set multi_union_pw_aff::bind(isl::multi_id tuple) const
15320 {
15321   if (!ptr || tuple.is_null())
15322     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15323   auto saved_ctx = ctx();
15324   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15325   auto res = isl_multi_union_pw_aff_bind(copy(), tuple.release());
15326   if (!res)
15327     exception::throw_last_error(saved_ctx);
15328   return manage(res);
15329 }
15330 
coalesce()15331 isl::multi_union_pw_aff multi_union_pw_aff::coalesce() const
15332 {
15333   if (!ptr)
15334     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15335   auto saved_ctx = ctx();
15336   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15337   auto res = isl_multi_union_pw_aff_coalesce(copy());
15338   if (!res)
15339     exception::throw_last_error(saved_ctx);
15340   return manage(res);
15341 }
15342 
domain()15343 isl::union_set multi_union_pw_aff::domain() const
15344 {
15345   if (!ptr)
15346     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15347   auto saved_ctx = ctx();
15348   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15349   auto res = isl_multi_union_pw_aff_domain(copy());
15350   if (!res)
15351     exception::throw_last_error(saved_ctx);
15352   return manage(res);
15353 }
15354 
flat_range_product(isl::multi_union_pw_aff multi2)15355 isl::multi_union_pw_aff multi_union_pw_aff::flat_range_product(isl::multi_union_pw_aff multi2) const
15356 {
15357   if (!ptr || multi2.is_null())
15358     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15359   auto saved_ctx = ctx();
15360   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15361   auto res = isl_multi_union_pw_aff_flat_range_product(copy(), multi2.release());
15362   if (!res)
15363     exception::throw_last_error(saved_ctx);
15364   return manage(res);
15365 }
15366 
gist(isl::union_set context)15367 isl::multi_union_pw_aff multi_union_pw_aff::gist(isl::union_set context) const
15368 {
15369   if (!ptr || context.is_null())
15370     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15371   auto saved_ctx = ctx();
15372   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15373   auto res = isl_multi_union_pw_aff_gist(copy(), context.release());
15374   if (!res)
15375     exception::throw_last_error(saved_ctx);
15376   return manage(res);
15377 }
15378 
has_range_tuple_id()15379 bool multi_union_pw_aff::has_range_tuple_id() const
15380 {
15381   if (!ptr)
15382     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15383   auto saved_ctx = ctx();
15384   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15385   auto res = isl_multi_union_pw_aff_has_range_tuple_id(get());
15386   if (res < 0)
15387     exception::throw_last_error(saved_ctx);
15388   return res;
15389 }
15390 
intersect_domain(isl::union_set uset)15391 isl::multi_union_pw_aff multi_union_pw_aff::intersect_domain(isl::union_set uset) const
15392 {
15393   if (!ptr || uset.is_null())
15394     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15395   auto saved_ctx = ctx();
15396   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15397   auto res = isl_multi_union_pw_aff_intersect_domain(copy(), uset.release());
15398   if (!res)
15399     exception::throw_last_error(saved_ctx);
15400   return manage(res);
15401 }
15402 
intersect_params(isl::set params)15403 isl::multi_union_pw_aff multi_union_pw_aff::intersect_params(isl::set params) const
15404 {
15405   if (!ptr || params.is_null())
15406     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15407   auto saved_ctx = ctx();
15408   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15409   auto res = isl_multi_union_pw_aff_intersect_params(copy(), params.release());
15410   if (!res)
15411     exception::throw_last_error(saved_ctx);
15412   return manage(res);
15413 }
15414 
involves_nan()15415 bool multi_union_pw_aff::involves_nan() const
15416 {
15417   if (!ptr)
15418     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15419   auto saved_ctx = ctx();
15420   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15421   auto res = isl_multi_union_pw_aff_involves_nan(get());
15422   if (res < 0)
15423     exception::throw_last_error(saved_ctx);
15424   return res;
15425 }
15426 
list()15427 isl::union_pw_aff_list multi_union_pw_aff::list() const
15428 {
15429   if (!ptr)
15430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15431   auto saved_ctx = ctx();
15432   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15433   auto res = isl_multi_union_pw_aff_get_list(get());
15434   if (!res)
15435     exception::throw_last_error(saved_ctx);
15436   return manage(res);
15437 }
15438 
get_list()15439 isl::union_pw_aff_list multi_union_pw_aff::get_list() const
15440 {
15441   return list();
15442 }
15443 
neg()15444 isl::multi_union_pw_aff multi_union_pw_aff::neg() const
15445 {
15446   if (!ptr)
15447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15448   auto saved_ctx = ctx();
15449   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15450   auto res = isl_multi_union_pw_aff_neg(copy());
15451   if (!res)
15452     exception::throw_last_error(saved_ctx);
15453   return manage(res);
15454 }
15455 
plain_is_equal(const isl::multi_union_pw_aff & multi2)15456 bool multi_union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
15457 {
15458   if (!ptr || multi2.is_null())
15459     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15460   auto saved_ctx = ctx();
15461   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15462   auto res = isl_multi_union_pw_aff_plain_is_equal(get(), multi2.get());
15463   if (res < 0)
15464     exception::throw_last_error(saved_ctx);
15465   return res;
15466 }
15467 
pullback(isl::union_pw_multi_aff upma)15468 isl::multi_union_pw_aff multi_union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
15469 {
15470   if (!ptr || upma.is_null())
15471     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15472   auto saved_ctx = ctx();
15473   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15474   auto res = isl_multi_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
15475   if (!res)
15476     exception::throw_last_error(saved_ctx);
15477   return manage(res);
15478 }
15479 
range_product(isl::multi_union_pw_aff multi2)15480 isl::multi_union_pw_aff multi_union_pw_aff::range_product(isl::multi_union_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_union_pw_aff_range_product(copy(), multi2.release());
15487   if (!res)
15488     exception::throw_last_error(saved_ctx);
15489   return manage(res);
15490 }
15491 
range_tuple_id()15492 isl::id multi_union_pw_aff::range_tuple_id() const
15493 {
15494   if (!ptr)
15495     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15496   auto saved_ctx = ctx();
15497   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15498   auto res = isl_multi_union_pw_aff_get_range_tuple_id(get());
15499   if (!res)
15500     exception::throw_last_error(saved_ctx);
15501   return manage(res);
15502 }
15503 
get_range_tuple_id()15504 isl::id multi_union_pw_aff::get_range_tuple_id() const
15505 {
15506   return range_tuple_id();
15507 }
15508 
reset_range_tuple_id()15509 isl::multi_union_pw_aff multi_union_pw_aff::reset_range_tuple_id() const
15510 {
15511   if (!ptr)
15512     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15513   auto saved_ctx = ctx();
15514   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15515   auto res = isl_multi_union_pw_aff_reset_range_tuple_id(copy());
15516   if (!res)
15517     exception::throw_last_error(saved_ctx);
15518   return manage(res);
15519 }
15520 
scale(isl::multi_val mv)15521 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::multi_val mv) const
15522 {
15523   if (!ptr || mv.is_null())
15524     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15525   auto saved_ctx = ctx();
15526   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15527   auto res = isl_multi_union_pw_aff_scale_multi_val(copy(), mv.release());
15528   if (!res)
15529     exception::throw_last_error(saved_ctx);
15530   return manage(res);
15531 }
15532 
scale(isl::val v)15533 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::val v) const
15534 {
15535   if (!ptr || v.is_null())
15536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15537   auto saved_ctx = ctx();
15538   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15539   auto res = isl_multi_union_pw_aff_scale_val(copy(), v.release());
15540   if (!res)
15541     exception::throw_last_error(saved_ctx);
15542   return manage(res);
15543 }
15544 
scale(long v)15545 isl::multi_union_pw_aff multi_union_pw_aff::scale(long v) const
15546 {
15547   if (!ptr)
15548     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15549   return this->scale(isl::val(ctx(), v));
15550 }
15551 
scale_down(isl::multi_val mv)15552 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::multi_val mv) const
15553 {
15554   if (!ptr || mv.is_null())
15555     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15556   auto saved_ctx = ctx();
15557   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15558   auto res = isl_multi_union_pw_aff_scale_down_multi_val(copy(), mv.release());
15559   if (!res)
15560     exception::throw_last_error(saved_ctx);
15561   return manage(res);
15562 }
15563 
scale_down(isl::val v)15564 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::val v) const
15565 {
15566   if (!ptr || v.is_null())
15567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15568   auto saved_ctx = ctx();
15569   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15570   auto res = isl_multi_union_pw_aff_scale_down_val(copy(), v.release());
15571   if (!res)
15572     exception::throw_last_error(saved_ctx);
15573   return manage(res);
15574 }
15575 
scale_down(long v)15576 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(long v) const
15577 {
15578   if (!ptr)
15579     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15580   return this->scale_down(isl::val(ctx(), v));
15581 }
15582 
set_at(int pos,isl::union_pw_aff el)15583 isl::multi_union_pw_aff multi_union_pw_aff::set_at(int pos, isl::union_pw_aff el) const
15584 {
15585   if (!ptr || el.is_null())
15586     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15587   auto saved_ctx = ctx();
15588   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15589   auto res = isl_multi_union_pw_aff_set_at(copy(), pos, el.release());
15590   if (!res)
15591     exception::throw_last_error(saved_ctx);
15592   return manage(res);
15593 }
15594 
set_range_tuple(isl::id id)15595 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(isl::id id) const
15596 {
15597   if (!ptr || id.is_null())
15598     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15599   auto saved_ctx = ctx();
15600   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15601   auto res = isl_multi_union_pw_aff_set_range_tuple_id(copy(), id.release());
15602   if (!res)
15603     exception::throw_last_error(saved_ctx);
15604   return manage(res);
15605 }
15606 
set_range_tuple(const std::string & id)15607 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(const std::string &id) const
15608 {
15609   if (!ptr)
15610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15611   return this->set_range_tuple(isl::id(ctx(), id));
15612 }
15613 
size()15614 unsigned multi_union_pw_aff::size() const
15615 {
15616   if (!ptr)
15617     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15618   auto saved_ctx = ctx();
15619   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15620   auto res = isl_multi_union_pw_aff_size(get());
15621   if (res < 0)
15622     exception::throw_last_error(saved_ctx);
15623   return res;
15624 }
15625 
space()15626 isl::space multi_union_pw_aff::space() const
15627 {
15628   if (!ptr)
15629     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15630   auto saved_ctx = ctx();
15631   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15632   auto res = isl_multi_union_pw_aff_get_space(get());
15633   if (!res)
15634     exception::throw_last_error(saved_ctx);
15635   return manage(res);
15636 }
15637 
get_space()15638 isl::space multi_union_pw_aff::get_space() const
15639 {
15640   return space();
15641 }
15642 
sub(isl::multi_union_pw_aff multi2)15643 isl::multi_union_pw_aff multi_union_pw_aff::sub(isl::multi_union_pw_aff multi2) const
15644 {
15645   if (!ptr || multi2.is_null())
15646     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15647   auto saved_ctx = ctx();
15648   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15649   auto res = isl_multi_union_pw_aff_sub(copy(), multi2.release());
15650   if (!res)
15651     exception::throw_last_error(saved_ctx);
15652   return manage(res);
15653 }
15654 
union_add(isl::multi_union_pw_aff mupa2)15655 isl::multi_union_pw_aff multi_union_pw_aff::union_add(isl::multi_union_pw_aff mupa2) const
15656 {
15657   if (!ptr || mupa2.is_null())
15658     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15659   auto saved_ctx = ctx();
15660   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15661   auto res = isl_multi_union_pw_aff_union_add(copy(), mupa2.release());
15662   if (!res)
15663     exception::throw_last_error(saved_ctx);
15664   return manage(res);
15665 }
15666 
zero(isl::space space)15667 isl::multi_union_pw_aff multi_union_pw_aff::zero(isl::space space)
15668 {
15669   if (space.is_null())
15670     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15671   auto saved_ctx = space.ctx();
15672   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15673   auto res = isl_multi_union_pw_aff_zero(space.release());
15674   if (!res)
15675     exception::throw_last_error(saved_ctx);
15676   return manage(res);
15677 }
15678 
15679 inline std::ostream &operator<<(std::ostream &os, const multi_union_pw_aff &obj)
15680 {
15681   if (!obj.get())
15682     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15683   auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.get());
15684   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15685   char *str = isl_multi_union_pw_aff_to_str(obj.get());
15686   if (!str)
15687     exception::throw_last_error(saved_ctx);
15688   os << str;
15689   free(str);
15690   return os;
15691 }
15692 
15693 // implementations for isl::multi_val
manage(__isl_take isl_multi_val * ptr)15694 multi_val manage(__isl_take isl_multi_val *ptr) {
15695   if (!ptr)
15696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15697   return multi_val(ptr);
15698 }
manage_copy(__isl_keep isl_multi_val * ptr)15699 multi_val manage_copy(__isl_keep isl_multi_val *ptr) {
15700   if (!ptr)
15701     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15702   auto saved_ctx = isl_multi_val_get_ctx(ptr);
15703   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15704   ptr = isl_multi_val_copy(ptr);
15705   if (!ptr)
15706     exception::throw_last_error(saved_ctx);
15707   return multi_val(ptr);
15708 }
15709 
multi_val()15710 multi_val::multi_val()
15711     : ptr(nullptr) {}
15712 
multi_val(const multi_val & obj)15713 multi_val::multi_val(const multi_val &obj)
15714     : ptr(nullptr)
15715 {
15716   if (!obj.ptr)
15717     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15718   auto saved_ctx = isl_multi_val_get_ctx(obj.ptr);
15719   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15720   ptr = obj.copy();
15721   if (!ptr)
15722     exception::throw_last_error(saved_ctx);
15723 }
15724 
multi_val(__isl_take isl_multi_val * ptr)15725 multi_val::multi_val(__isl_take isl_multi_val *ptr)
15726     : ptr(ptr) {}
15727 
multi_val(isl::space space,isl::val_list list)15728 multi_val::multi_val(isl::space space, isl::val_list list)
15729 {
15730   if (space.is_null() || list.is_null())
15731     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15732   auto saved_ctx = space.ctx();
15733   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15734   auto res = isl_multi_val_from_val_list(space.release(), list.release());
15735   if (!res)
15736     exception::throw_last_error(saved_ctx);
15737   ptr = res;
15738 }
15739 
multi_val(isl::ctx ctx,const std::string & str)15740 multi_val::multi_val(isl::ctx ctx, const std::string &str)
15741 {
15742   auto saved_ctx = ctx;
15743   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15744   auto res = isl_multi_val_read_from_str(ctx.release(), str.c_str());
15745   if (!res)
15746     exception::throw_last_error(saved_ctx);
15747   ptr = res;
15748 }
15749 
15750 multi_val &multi_val::operator=(multi_val obj) {
15751   std::swap(this->ptr, obj.ptr);
15752   return *this;
15753 }
15754 
~multi_val()15755 multi_val::~multi_val() {
15756   if (ptr)
15757     isl_multi_val_free(ptr);
15758 }
15759 
copy()15760 __isl_give isl_multi_val *multi_val::copy() const & {
15761   return isl_multi_val_copy(ptr);
15762 }
15763 
get()15764 __isl_keep isl_multi_val *multi_val::get() const {
15765   return ptr;
15766 }
15767 
release()15768 __isl_give isl_multi_val *multi_val::release() {
15769   isl_multi_val *tmp = ptr;
15770   ptr = nullptr;
15771   return tmp;
15772 }
15773 
is_null()15774 bool multi_val::is_null() const {
15775   return ptr == nullptr;
15776 }
15777 
ctx()15778 isl::ctx multi_val::ctx() const {
15779   return isl::ctx(isl_multi_val_get_ctx(ptr));
15780 }
15781 
add(isl::multi_val multi2)15782 isl::multi_val multi_val::add(isl::multi_val multi2) const
15783 {
15784   if (!ptr || multi2.is_null())
15785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15786   auto saved_ctx = ctx();
15787   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15788   auto res = isl_multi_val_add(copy(), multi2.release());
15789   if (!res)
15790     exception::throw_last_error(saved_ctx);
15791   return manage(res);
15792 }
15793 
add(isl::val v)15794 isl::multi_val multi_val::add(isl::val v) const
15795 {
15796   if (!ptr || v.is_null())
15797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15798   auto saved_ctx = ctx();
15799   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15800   auto res = isl_multi_val_add_val(copy(), v.release());
15801   if (!res)
15802     exception::throw_last_error(saved_ctx);
15803   return manage(res);
15804 }
15805 
add(long v)15806 isl::multi_val multi_val::add(long v) const
15807 {
15808   if (!ptr)
15809     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15810   return this->add(isl::val(ctx(), v));
15811 }
15812 
at(int pos)15813 isl::val multi_val::at(int pos) const
15814 {
15815   if (!ptr)
15816     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15817   auto saved_ctx = ctx();
15818   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15819   auto res = isl_multi_val_get_at(get(), pos);
15820   if (!res)
15821     exception::throw_last_error(saved_ctx);
15822   return manage(res);
15823 }
15824 
get_at(int pos)15825 isl::val multi_val::get_at(int pos) const
15826 {
15827   return at(pos);
15828 }
15829 
flat_range_product(isl::multi_val multi2)15830 isl::multi_val multi_val::flat_range_product(isl::multi_val multi2) const
15831 {
15832   if (!ptr || multi2.is_null())
15833     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15834   auto saved_ctx = ctx();
15835   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15836   auto res = isl_multi_val_flat_range_product(copy(), multi2.release());
15837   if (!res)
15838     exception::throw_last_error(saved_ctx);
15839   return manage(res);
15840 }
15841 
has_range_tuple_id()15842 bool multi_val::has_range_tuple_id() const
15843 {
15844   if (!ptr)
15845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15846   auto saved_ctx = ctx();
15847   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15848   auto res = isl_multi_val_has_range_tuple_id(get());
15849   if (res < 0)
15850     exception::throw_last_error(saved_ctx);
15851   return res;
15852 }
15853 
involves_nan()15854 bool multi_val::involves_nan() const
15855 {
15856   if (!ptr)
15857     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15858   auto saved_ctx = ctx();
15859   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15860   auto res = isl_multi_val_involves_nan(get());
15861   if (res < 0)
15862     exception::throw_last_error(saved_ctx);
15863   return res;
15864 }
15865 
list()15866 isl::val_list multi_val::list() const
15867 {
15868   if (!ptr)
15869     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15870   auto saved_ctx = ctx();
15871   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15872   auto res = isl_multi_val_get_list(get());
15873   if (!res)
15874     exception::throw_last_error(saved_ctx);
15875   return manage(res);
15876 }
15877 
get_list()15878 isl::val_list multi_val::get_list() const
15879 {
15880   return list();
15881 }
15882 
max(isl::multi_val multi2)15883 isl::multi_val multi_val::max(isl::multi_val multi2) const
15884 {
15885   if (!ptr || multi2.is_null())
15886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15887   auto saved_ctx = ctx();
15888   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15889   auto res = isl_multi_val_max(copy(), multi2.release());
15890   if (!res)
15891     exception::throw_last_error(saved_ctx);
15892   return manage(res);
15893 }
15894 
min(isl::multi_val multi2)15895 isl::multi_val multi_val::min(isl::multi_val multi2) const
15896 {
15897   if (!ptr || multi2.is_null())
15898     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15899   auto saved_ctx = ctx();
15900   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15901   auto res = isl_multi_val_min(copy(), multi2.release());
15902   if (!res)
15903     exception::throw_last_error(saved_ctx);
15904   return manage(res);
15905 }
15906 
neg()15907 isl::multi_val multi_val::neg() const
15908 {
15909   if (!ptr)
15910     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15911   auto saved_ctx = ctx();
15912   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15913   auto res = isl_multi_val_neg(copy());
15914   if (!res)
15915     exception::throw_last_error(saved_ctx);
15916   return manage(res);
15917 }
15918 
plain_is_equal(const isl::multi_val & multi2)15919 bool multi_val::plain_is_equal(const isl::multi_val &multi2) const
15920 {
15921   if (!ptr || multi2.is_null())
15922     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15923   auto saved_ctx = ctx();
15924   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15925   auto res = isl_multi_val_plain_is_equal(get(), multi2.get());
15926   if (res < 0)
15927     exception::throw_last_error(saved_ctx);
15928   return res;
15929 }
15930 
product(isl::multi_val multi2)15931 isl::multi_val multi_val::product(isl::multi_val multi2) const
15932 {
15933   if (!ptr || multi2.is_null())
15934     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15935   auto saved_ctx = ctx();
15936   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15937   auto res = isl_multi_val_product(copy(), multi2.release());
15938   if (!res)
15939     exception::throw_last_error(saved_ctx);
15940   return manage(res);
15941 }
15942 
range_product(isl::multi_val multi2)15943 isl::multi_val multi_val::range_product(isl::multi_val multi2) const
15944 {
15945   if (!ptr || multi2.is_null())
15946     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15947   auto saved_ctx = ctx();
15948   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15949   auto res = isl_multi_val_range_product(copy(), multi2.release());
15950   if (!res)
15951     exception::throw_last_error(saved_ctx);
15952   return manage(res);
15953 }
15954 
range_tuple_id()15955 isl::id multi_val::range_tuple_id() const
15956 {
15957   if (!ptr)
15958     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15959   auto saved_ctx = ctx();
15960   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15961   auto res = isl_multi_val_get_range_tuple_id(get());
15962   if (!res)
15963     exception::throw_last_error(saved_ctx);
15964   return manage(res);
15965 }
15966 
get_range_tuple_id()15967 isl::id multi_val::get_range_tuple_id() const
15968 {
15969   return range_tuple_id();
15970 }
15971 
reset_range_tuple_id()15972 isl::multi_val multi_val::reset_range_tuple_id() const
15973 {
15974   if (!ptr)
15975     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15976   auto saved_ctx = ctx();
15977   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15978   auto res = isl_multi_val_reset_range_tuple_id(copy());
15979   if (!res)
15980     exception::throw_last_error(saved_ctx);
15981   return manage(res);
15982 }
15983 
scale(isl::multi_val mv)15984 isl::multi_val multi_val::scale(isl::multi_val mv) const
15985 {
15986   if (!ptr || mv.is_null())
15987     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15988   auto saved_ctx = ctx();
15989   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15990   auto res = isl_multi_val_scale_multi_val(copy(), mv.release());
15991   if (!res)
15992     exception::throw_last_error(saved_ctx);
15993   return manage(res);
15994 }
15995 
scale(isl::val v)15996 isl::multi_val multi_val::scale(isl::val v) const
15997 {
15998   if (!ptr || v.is_null())
15999     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16000   auto saved_ctx = ctx();
16001   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16002   auto res = isl_multi_val_scale_val(copy(), v.release());
16003   if (!res)
16004     exception::throw_last_error(saved_ctx);
16005   return manage(res);
16006 }
16007 
scale(long v)16008 isl::multi_val multi_val::scale(long v) const
16009 {
16010   if (!ptr)
16011     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16012   return this->scale(isl::val(ctx(), v));
16013 }
16014 
scale_down(isl::multi_val mv)16015 isl::multi_val multi_val::scale_down(isl::multi_val mv) const
16016 {
16017   if (!ptr || mv.is_null())
16018     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16019   auto saved_ctx = ctx();
16020   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16021   auto res = isl_multi_val_scale_down_multi_val(copy(), mv.release());
16022   if (!res)
16023     exception::throw_last_error(saved_ctx);
16024   return manage(res);
16025 }
16026 
scale_down(isl::val v)16027 isl::multi_val multi_val::scale_down(isl::val v) const
16028 {
16029   if (!ptr || v.is_null())
16030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16031   auto saved_ctx = ctx();
16032   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16033   auto res = isl_multi_val_scale_down_val(copy(), v.release());
16034   if (!res)
16035     exception::throw_last_error(saved_ctx);
16036   return manage(res);
16037 }
16038 
scale_down(long v)16039 isl::multi_val multi_val::scale_down(long v) const
16040 {
16041   if (!ptr)
16042     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16043   return this->scale_down(isl::val(ctx(), v));
16044 }
16045 
set_at(int pos,isl::val el)16046 isl::multi_val multi_val::set_at(int pos, isl::val el) const
16047 {
16048   if (!ptr || el.is_null())
16049     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16050   auto saved_ctx = ctx();
16051   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16052   auto res = isl_multi_val_set_at(copy(), pos, el.release());
16053   if (!res)
16054     exception::throw_last_error(saved_ctx);
16055   return manage(res);
16056 }
16057 
set_at(int pos,long el)16058 isl::multi_val multi_val::set_at(int pos, long el) const
16059 {
16060   if (!ptr)
16061     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16062   return this->set_at(pos, isl::val(ctx(), el));
16063 }
16064 
set_range_tuple(isl::id id)16065 isl::multi_val multi_val::set_range_tuple(isl::id id) const
16066 {
16067   if (!ptr || id.is_null())
16068     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16069   auto saved_ctx = ctx();
16070   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16071   auto res = isl_multi_val_set_range_tuple_id(copy(), id.release());
16072   if (!res)
16073     exception::throw_last_error(saved_ctx);
16074   return manage(res);
16075 }
16076 
set_range_tuple(const std::string & id)16077 isl::multi_val multi_val::set_range_tuple(const std::string &id) const
16078 {
16079   if (!ptr)
16080     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16081   return this->set_range_tuple(isl::id(ctx(), id));
16082 }
16083 
size()16084 unsigned multi_val::size() const
16085 {
16086   if (!ptr)
16087     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16088   auto saved_ctx = ctx();
16089   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16090   auto res = isl_multi_val_size(get());
16091   if (res < 0)
16092     exception::throw_last_error(saved_ctx);
16093   return res;
16094 }
16095 
space()16096 isl::space multi_val::space() const
16097 {
16098   if (!ptr)
16099     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16100   auto saved_ctx = ctx();
16101   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16102   auto res = isl_multi_val_get_space(get());
16103   if (!res)
16104     exception::throw_last_error(saved_ctx);
16105   return manage(res);
16106 }
16107 
get_space()16108 isl::space multi_val::get_space() const
16109 {
16110   return space();
16111 }
16112 
sub(isl::multi_val multi2)16113 isl::multi_val multi_val::sub(isl::multi_val multi2) const
16114 {
16115   if (!ptr || multi2.is_null())
16116     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16117   auto saved_ctx = ctx();
16118   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16119   auto res = isl_multi_val_sub(copy(), multi2.release());
16120   if (!res)
16121     exception::throw_last_error(saved_ctx);
16122   return manage(res);
16123 }
16124 
zero(isl::space space)16125 isl::multi_val multi_val::zero(isl::space space)
16126 {
16127   if (space.is_null())
16128     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16129   auto saved_ctx = space.ctx();
16130   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16131   auto res = isl_multi_val_zero(space.release());
16132   if (!res)
16133     exception::throw_last_error(saved_ctx);
16134   return manage(res);
16135 }
16136 
16137 inline std::ostream &operator<<(std::ostream &os, const multi_val &obj)
16138 {
16139   if (!obj.get())
16140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16141   auto saved_ctx = isl_multi_val_get_ctx(obj.get());
16142   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16143   char *str = isl_multi_val_to_str(obj.get());
16144   if (!str)
16145     exception::throw_last_error(saved_ctx);
16146   os << str;
16147   free(str);
16148   return os;
16149 }
16150 
16151 // implementations for isl::point
manage(__isl_take isl_point * ptr)16152 point manage(__isl_take isl_point *ptr) {
16153   if (!ptr)
16154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16155   return point(ptr);
16156 }
manage_copy(__isl_keep isl_point * ptr)16157 point manage_copy(__isl_keep isl_point *ptr) {
16158   if (!ptr)
16159     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16160   auto saved_ctx = isl_point_get_ctx(ptr);
16161   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16162   ptr = isl_point_copy(ptr);
16163   if (!ptr)
16164     exception::throw_last_error(saved_ctx);
16165   return point(ptr);
16166 }
16167 
point()16168 point::point()
16169     : ptr(nullptr) {}
16170 
point(const point & obj)16171 point::point(const point &obj)
16172     : ptr(nullptr)
16173 {
16174   if (!obj.ptr)
16175     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16176   auto saved_ctx = isl_point_get_ctx(obj.ptr);
16177   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16178   ptr = obj.copy();
16179   if (!ptr)
16180     exception::throw_last_error(saved_ctx);
16181 }
16182 
point(__isl_take isl_point * ptr)16183 point::point(__isl_take isl_point *ptr)
16184     : ptr(ptr) {}
16185 
16186 point &point::operator=(point obj) {
16187   std::swap(this->ptr, obj.ptr);
16188   return *this;
16189 }
16190 
~point()16191 point::~point() {
16192   if (ptr)
16193     isl_point_free(ptr);
16194 }
16195 
copy()16196 __isl_give isl_point *point::copy() const & {
16197   return isl_point_copy(ptr);
16198 }
16199 
get()16200 __isl_keep isl_point *point::get() const {
16201   return ptr;
16202 }
16203 
release()16204 __isl_give isl_point *point::release() {
16205   isl_point *tmp = ptr;
16206   ptr = nullptr;
16207   return tmp;
16208 }
16209 
is_null()16210 bool point::is_null() const {
16211   return ptr == nullptr;
16212 }
16213 
ctx()16214 isl::ctx point::ctx() const {
16215   return isl::ctx(isl_point_get_ctx(ptr));
16216 }
16217 
affine_hull()16218 isl::basic_set point::affine_hull() const
16219 {
16220   if (!ptr)
16221     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16222   return isl::basic_set(*this).affine_hull();
16223 }
16224 
apply(const isl::basic_map & bmap)16225 isl::basic_set point::apply(const isl::basic_map &bmap) const
16226 {
16227   if (!ptr)
16228     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16229   return isl::basic_set(*this).apply(bmap);
16230 }
16231 
apply(const isl::map & map)16232 isl::set point::apply(const isl::map &map) const
16233 {
16234   if (!ptr)
16235     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16236   return isl::basic_set(*this).apply(map);
16237 }
16238 
apply(const isl::union_map & umap)16239 isl::union_set point::apply(const isl::union_map &umap) const
16240 {
16241   if (!ptr)
16242     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16243   return isl::basic_set(*this).apply(umap);
16244 }
16245 
as_pw_multi_aff()16246 isl::pw_multi_aff point::as_pw_multi_aff() const
16247 {
16248   if (!ptr)
16249     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16250   return isl::basic_set(*this).as_pw_multi_aff();
16251 }
16252 
as_set()16253 isl::set point::as_set() const
16254 {
16255   if (!ptr)
16256     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16257   return isl::basic_set(*this).as_set();
16258 }
16259 
bind(const isl::multi_id & tuple)16260 isl::set point::bind(const isl::multi_id &tuple) const
16261 {
16262   if (!ptr)
16263     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16264   return isl::basic_set(*this).bind(tuple);
16265 }
16266 
coalesce()16267 isl::set point::coalesce() const
16268 {
16269   if (!ptr)
16270     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16271   return isl::basic_set(*this).coalesce();
16272 }
16273 
complement()16274 isl::set point::complement() const
16275 {
16276   if (!ptr)
16277     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16278   return isl::basic_set(*this).complement();
16279 }
16280 
compute_divs()16281 isl::union_set point::compute_divs() const
16282 {
16283   if (!ptr)
16284     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16285   return isl::basic_set(*this).compute_divs();
16286 }
16287 
detect_equalities()16288 isl::basic_set point::detect_equalities() const
16289 {
16290   if (!ptr)
16291     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16292   return isl::basic_set(*this).detect_equalities();
16293 }
16294 
dim_max_val(int pos)16295 isl::val point::dim_max_val(int pos) const
16296 {
16297   if (!ptr)
16298     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16299   return isl::basic_set(*this).dim_max_val(pos);
16300 }
16301 
dim_min_val(int pos)16302 isl::val point::dim_min_val(int pos) const
16303 {
16304   if (!ptr)
16305     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16306   return isl::basic_set(*this).dim_min_val(pos);
16307 }
16308 
every_set(const std::function<bool (isl::set)> & test)16309 bool point::every_set(const std::function<bool(isl::set)> &test) const
16310 {
16311   if (!ptr)
16312     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16313   return isl::basic_set(*this).every_set(test);
16314 }
16315 
extract_set(const isl::space & space)16316 isl::set point::extract_set(const isl::space &space) const
16317 {
16318   if (!ptr)
16319     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16320   return isl::basic_set(*this).extract_set(space);
16321 }
16322 
flatten()16323 isl::basic_set point::flatten() const
16324 {
16325   if (!ptr)
16326     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16327   return isl::basic_set(*this).flatten();
16328 }
16329 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)16330 void point::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
16331 {
16332   if (!ptr)
16333     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16334   return isl::basic_set(*this).foreach_basic_set(fn);
16335 }
16336 
foreach_point(const std::function<void (isl::point)> & fn)16337 void point::foreach_point(const std::function<void(isl::point)> &fn) const
16338 {
16339   if (!ptr)
16340     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16341   return isl::basic_set(*this).foreach_point(fn);
16342 }
16343 
foreach_set(const std::function<void (isl::set)> & fn)16344 void point::foreach_set(const std::function<void(isl::set)> &fn) const
16345 {
16346   if (!ptr)
16347     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16348   return isl::basic_set(*this).foreach_set(fn);
16349 }
16350 
gist(const isl::basic_set & context)16351 isl::basic_set point::gist(const isl::basic_set &context) const
16352 {
16353   if (!ptr)
16354     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16355   return isl::basic_set(*this).gist(context);
16356 }
16357 
gist(const isl::set & context)16358 isl::set point::gist(const isl::set &context) const
16359 {
16360   if (!ptr)
16361     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16362   return isl::basic_set(*this).gist(context);
16363 }
16364 
gist(const isl::union_set & context)16365 isl::union_set point::gist(const isl::union_set &context) const
16366 {
16367   if (!ptr)
16368     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16369   return isl::basic_set(*this).gist(context);
16370 }
16371 
gist_params(const isl::set & set)16372 isl::union_set point::gist_params(const isl::set &set) const
16373 {
16374   if (!ptr)
16375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16376   return isl::basic_set(*this).gist_params(set);
16377 }
16378 
identity()16379 isl::map point::identity() const
16380 {
16381   if (!ptr)
16382     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16383   return isl::basic_set(*this).identity();
16384 }
16385 
indicator_function()16386 isl::pw_aff point::indicator_function() const
16387 {
16388   if (!ptr)
16389     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16390   return isl::basic_set(*this).indicator_function();
16391 }
16392 
insert_domain(const isl::space & domain)16393 isl::map point::insert_domain(const isl::space &domain) const
16394 {
16395   if (!ptr)
16396     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16397   return isl::basic_set(*this).insert_domain(domain);
16398 }
16399 
intersect(const isl::basic_set & bset2)16400 isl::basic_set point::intersect(const isl::basic_set &bset2) const
16401 {
16402   if (!ptr)
16403     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16404   return isl::basic_set(*this).intersect(bset2);
16405 }
16406 
intersect(const isl::set & set2)16407 isl::set point::intersect(const isl::set &set2) const
16408 {
16409   if (!ptr)
16410     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16411   return isl::basic_set(*this).intersect(set2);
16412 }
16413 
intersect(const isl::union_set & uset2)16414 isl::union_set point::intersect(const isl::union_set &uset2) const
16415 {
16416   if (!ptr)
16417     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16418   return isl::basic_set(*this).intersect(uset2);
16419 }
16420 
intersect_params(const isl::basic_set & bset2)16421 isl::basic_set point::intersect_params(const isl::basic_set &bset2) const
16422 {
16423   if (!ptr)
16424     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16425   return isl::basic_set(*this).intersect_params(bset2);
16426 }
16427 
intersect_params(const isl::set & params)16428 isl::set point::intersect_params(const isl::set &params) const
16429 {
16430   if (!ptr)
16431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16432   return isl::basic_set(*this).intersect_params(params);
16433 }
16434 
involves_locals()16435 bool point::involves_locals() const
16436 {
16437   if (!ptr)
16438     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16439   return isl::basic_set(*this).involves_locals();
16440 }
16441 
is_disjoint(const isl::set & set2)16442 bool point::is_disjoint(const isl::set &set2) const
16443 {
16444   if (!ptr)
16445     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16446   return isl::basic_set(*this).is_disjoint(set2);
16447 }
16448 
is_disjoint(const isl::union_set & uset2)16449 bool point::is_disjoint(const isl::union_set &uset2) const
16450 {
16451   if (!ptr)
16452     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16453   return isl::basic_set(*this).is_disjoint(uset2);
16454 }
16455 
is_empty()16456 bool point::is_empty() const
16457 {
16458   if (!ptr)
16459     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16460   return isl::basic_set(*this).is_empty();
16461 }
16462 
is_equal(const isl::basic_set & bset2)16463 bool point::is_equal(const isl::basic_set &bset2) const
16464 {
16465   if (!ptr)
16466     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16467   return isl::basic_set(*this).is_equal(bset2);
16468 }
16469 
is_equal(const isl::set & set2)16470 bool point::is_equal(const isl::set &set2) const
16471 {
16472   if (!ptr)
16473     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16474   return isl::basic_set(*this).is_equal(set2);
16475 }
16476 
is_equal(const isl::union_set & uset2)16477 bool point::is_equal(const isl::union_set &uset2) const
16478 {
16479   if (!ptr)
16480     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16481   return isl::basic_set(*this).is_equal(uset2);
16482 }
16483 
is_singleton()16484 bool point::is_singleton() const
16485 {
16486   if (!ptr)
16487     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16488   return isl::basic_set(*this).is_singleton();
16489 }
16490 
is_strict_subset(const isl::set & set2)16491 bool point::is_strict_subset(const isl::set &set2) const
16492 {
16493   if (!ptr)
16494     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16495   return isl::basic_set(*this).is_strict_subset(set2);
16496 }
16497 
is_strict_subset(const isl::union_set & uset2)16498 bool point::is_strict_subset(const isl::union_set &uset2) const
16499 {
16500   if (!ptr)
16501     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16502   return isl::basic_set(*this).is_strict_subset(uset2);
16503 }
16504 
is_subset(const isl::basic_set & bset2)16505 bool point::is_subset(const isl::basic_set &bset2) const
16506 {
16507   if (!ptr)
16508     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16509   return isl::basic_set(*this).is_subset(bset2);
16510 }
16511 
is_subset(const isl::set & set2)16512 bool point::is_subset(const isl::set &set2) const
16513 {
16514   if (!ptr)
16515     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16516   return isl::basic_set(*this).is_subset(set2);
16517 }
16518 
is_subset(const isl::union_set & uset2)16519 bool point::is_subset(const isl::union_set &uset2) const
16520 {
16521   if (!ptr)
16522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16523   return isl::basic_set(*this).is_subset(uset2);
16524 }
16525 
is_wrapping()16526 bool point::is_wrapping() const
16527 {
16528   if (!ptr)
16529     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16530   return isl::basic_set(*this).is_wrapping();
16531 }
16532 
isa_set()16533 bool point::isa_set() const
16534 {
16535   if (!ptr)
16536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16537   return isl::basic_set(*this).isa_set();
16538 }
16539 
lexmax()16540 isl::set point::lexmax() const
16541 {
16542   if (!ptr)
16543     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16544   return isl::basic_set(*this).lexmax();
16545 }
16546 
lexmax_pw_multi_aff()16547 isl::pw_multi_aff point::lexmax_pw_multi_aff() const
16548 {
16549   if (!ptr)
16550     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16551   return isl::basic_set(*this).lexmax_pw_multi_aff();
16552 }
16553 
lexmin()16554 isl::set point::lexmin() const
16555 {
16556   if (!ptr)
16557     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16558   return isl::basic_set(*this).lexmin();
16559 }
16560 
lexmin_pw_multi_aff()16561 isl::pw_multi_aff point::lexmin_pw_multi_aff() const
16562 {
16563   if (!ptr)
16564     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16565   return isl::basic_set(*this).lexmin_pw_multi_aff();
16566 }
16567 
lower_bound(const isl::multi_pw_aff & lower)16568 isl::set point::lower_bound(const isl::multi_pw_aff &lower) const
16569 {
16570   if (!ptr)
16571     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16572   return isl::basic_set(*this).lower_bound(lower);
16573 }
16574 
lower_bound(const isl::multi_val & lower)16575 isl::set point::lower_bound(const isl::multi_val &lower) const
16576 {
16577   if (!ptr)
16578     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16579   return isl::basic_set(*this).lower_bound(lower);
16580 }
16581 
max_multi_pw_aff()16582 isl::multi_pw_aff point::max_multi_pw_aff() const
16583 {
16584   if (!ptr)
16585     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16586   return isl::basic_set(*this).max_multi_pw_aff();
16587 }
16588 
max_val(const isl::aff & obj)16589 isl::val point::max_val(const isl::aff &obj) const
16590 {
16591   if (!ptr)
16592     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16593   return isl::basic_set(*this).max_val(obj);
16594 }
16595 
min_multi_pw_aff()16596 isl::multi_pw_aff point::min_multi_pw_aff() const
16597 {
16598   if (!ptr)
16599     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16600   return isl::basic_set(*this).min_multi_pw_aff();
16601 }
16602 
min_val(const isl::aff & obj)16603 isl::val point::min_val(const isl::aff &obj) const
16604 {
16605   if (!ptr)
16606     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16607   return isl::basic_set(*this).min_val(obj);
16608 }
16609 
multi_val()16610 isl::multi_val point::multi_val() const
16611 {
16612   if (!ptr)
16613     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16614   auto saved_ctx = ctx();
16615   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16616   auto res = isl_point_get_multi_val(get());
16617   if (!res)
16618     exception::throw_last_error(saved_ctx);
16619   return manage(res);
16620 }
16621 
get_multi_val()16622 isl::multi_val point::get_multi_val() const
16623 {
16624   return multi_val();
16625 }
16626 
n_basic_set()16627 unsigned point::n_basic_set() const
16628 {
16629   if (!ptr)
16630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16631   return isl::basic_set(*this).n_basic_set();
16632 }
16633 
params()16634 isl::basic_set point::params() const
16635 {
16636   if (!ptr)
16637     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16638   return isl::basic_set(*this).params();
16639 }
16640 
plain_multi_val_if_fixed()16641 isl::multi_val point::plain_multi_val_if_fixed() const
16642 {
16643   if (!ptr)
16644     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16645   return isl::basic_set(*this).plain_multi_val_if_fixed();
16646 }
16647 
polyhedral_hull()16648 isl::basic_set point::polyhedral_hull() const
16649 {
16650   if (!ptr)
16651     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16652   return isl::basic_set(*this).polyhedral_hull();
16653 }
16654 
preimage(const isl::multi_aff & ma)16655 isl::set point::preimage(const isl::multi_aff &ma) const
16656 {
16657   if (!ptr)
16658     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16659   return isl::basic_set(*this).preimage(ma);
16660 }
16661 
preimage(const isl::multi_pw_aff & mpa)16662 isl::set point::preimage(const isl::multi_pw_aff &mpa) const
16663 {
16664   if (!ptr)
16665     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16666   return isl::basic_set(*this).preimage(mpa);
16667 }
16668 
preimage(const isl::pw_multi_aff & pma)16669 isl::set point::preimage(const isl::pw_multi_aff &pma) const
16670 {
16671   if (!ptr)
16672     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16673   return isl::basic_set(*this).preimage(pma);
16674 }
16675 
preimage(const isl::union_pw_multi_aff & upma)16676 isl::union_set point::preimage(const isl::union_pw_multi_aff &upma) const
16677 {
16678   if (!ptr)
16679     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16680   return isl::basic_set(*this).preimage(upma);
16681 }
16682 
product(const isl::set & set2)16683 isl::set point::product(const isl::set &set2) const
16684 {
16685   if (!ptr)
16686     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16687   return isl::basic_set(*this).product(set2);
16688 }
16689 
project_out_all_params()16690 isl::set point::project_out_all_params() const
16691 {
16692   if (!ptr)
16693     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16694   return isl::basic_set(*this).project_out_all_params();
16695 }
16696 
project_out_param(const isl::id & id)16697 isl::set point::project_out_param(const isl::id &id) const
16698 {
16699   if (!ptr)
16700     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16701   return isl::basic_set(*this).project_out_param(id);
16702 }
16703 
project_out_param(const std::string & id)16704 isl::set point::project_out_param(const std::string &id) const
16705 {
16706   if (!ptr)
16707     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16708   return this->project_out_param(isl::id(ctx(), id));
16709 }
16710 
project_out_param(const isl::id_list & list)16711 isl::set point::project_out_param(const isl::id_list &list) const
16712 {
16713   if (!ptr)
16714     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16715   return isl::basic_set(*this).project_out_param(list);
16716 }
16717 
pw_multi_aff_on_domain(const isl::multi_val & mv)16718 isl::pw_multi_aff point::pw_multi_aff_on_domain(const isl::multi_val &mv) const
16719 {
16720   if (!ptr)
16721     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16722   return isl::basic_set(*this).pw_multi_aff_on_domain(mv);
16723 }
16724 
sample()16725 isl::basic_set point::sample() const
16726 {
16727   if (!ptr)
16728     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16729   return isl::basic_set(*this).sample();
16730 }
16731 
sample_point()16732 isl::point point::sample_point() const
16733 {
16734   if (!ptr)
16735     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16736   return isl::basic_set(*this).sample_point();
16737 }
16738 
set_list()16739 isl::set_list point::set_list() const
16740 {
16741   if (!ptr)
16742     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16743   return isl::basic_set(*this).set_list();
16744 }
16745 
simple_fixed_box_hull()16746 isl::fixed_box point::simple_fixed_box_hull() const
16747 {
16748   if (!ptr)
16749     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16750   return isl::basic_set(*this).simple_fixed_box_hull();
16751 }
16752 
space()16753 isl::space point::space() const
16754 {
16755   if (!ptr)
16756     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16757   return isl::basic_set(*this).space();
16758 }
16759 
stride(int pos)16760 isl::val point::stride(int pos) const
16761 {
16762   if (!ptr)
16763     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16764   return isl::basic_set(*this).stride(pos);
16765 }
16766 
subtract(const isl::set & set2)16767 isl::set point::subtract(const isl::set &set2) const
16768 {
16769   if (!ptr)
16770     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16771   return isl::basic_set(*this).subtract(set2);
16772 }
16773 
subtract(const isl::union_set & uset2)16774 isl::union_set point::subtract(const isl::union_set &uset2) const
16775 {
16776   if (!ptr)
16777     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16778   return isl::basic_set(*this).subtract(uset2);
16779 }
16780 
to_list()16781 isl::set_list point::to_list() const
16782 {
16783   if (!ptr)
16784     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16785   return isl::basic_set(*this).to_list();
16786 }
16787 
to_set()16788 isl::set point::to_set() const
16789 {
16790   if (!ptr)
16791     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16792   auto saved_ctx = ctx();
16793   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16794   auto res = isl_point_to_set(copy());
16795   if (!res)
16796     exception::throw_last_error(saved_ctx);
16797   return manage(res);
16798 }
16799 
to_union_set()16800 isl::union_set point::to_union_set() const
16801 {
16802   if (!ptr)
16803     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16804   return isl::basic_set(*this).to_union_set();
16805 }
16806 
translation()16807 isl::map point::translation() const
16808 {
16809   if (!ptr)
16810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16811   return isl::basic_set(*this).translation();
16812 }
16813 
tuple_dim()16814 unsigned point::tuple_dim() const
16815 {
16816   if (!ptr)
16817     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16818   return isl::basic_set(*this).tuple_dim();
16819 }
16820 
unbind_params(const isl::multi_id & tuple)16821 isl::set point::unbind_params(const isl::multi_id &tuple) const
16822 {
16823   if (!ptr)
16824     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16825   return isl::basic_set(*this).unbind_params(tuple);
16826 }
16827 
unbind_params_insert_domain(const isl::multi_id & domain)16828 isl::map point::unbind_params_insert_domain(const isl::multi_id &domain) const
16829 {
16830   if (!ptr)
16831     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16832   return isl::basic_set(*this).unbind_params_insert_domain(domain);
16833 }
16834 
unite(const isl::basic_set & bset2)16835 isl::set point::unite(const isl::basic_set &bset2) const
16836 {
16837   if (!ptr)
16838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16839   return isl::basic_set(*this).unite(bset2);
16840 }
16841 
unite(const isl::set & set2)16842 isl::set point::unite(const isl::set &set2) const
16843 {
16844   if (!ptr)
16845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16846   return isl::basic_set(*this).unite(set2);
16847 }
16848 
unite(const isl::union_set & uset2)16849 isl::union_set point::unite(const isl::union_set &uset2) const
16850 {
16851   if (!ptr)
16852     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16853   return isl::basic_set(*this).unite(uset2);
16854 }
16855 
unshifted_simple_hull()16856 isl::basic_set point::unshifted_simple_hull() const
16857 {
16858   if (!ptr)
16859     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16860   return isl::basic_set(*this).unshifted_simple_hull();
16861 }
16862 
unwrap()16863 isl::map point::unwrap() const
16864 {
16865   if (!ptr)
16866     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16867   return isl::basic_set(*this).unwrap();
16868 }
16869 
upper_bound(const isl::multi_pw_aff & upper)16870 isl::set point::upper_bound(const isl::multi_pw_aff &upper) const
16871 {
16872   if (!ptr)
16873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16874   return isl::basic_set(*this).upper_bound(upper);
16875 }
16876 
upper_bound(const isl::multi_val & upper)16877 isl::set point::upper_bound(const isl::multi_val &upper) const
16878 {
16879   if (!ptr)
16880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16881   return isl::basic_set(*this).upper_bound(upper);
16882 }
16883 
16884 inline std::ostream &operator<<(std::ostream &os, const point &obj)
16885 {
16886   if (!obj.get())
16887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16888   auto saved_ctx = isl_point_get_ctx(obj.get());
16889   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16890   char *str = isl_point_to_str(obj.get());
16891   if (!str)
16892     exception::throw_last_error(saved_ctx);
16893   os << str;
16894   free(str);
16895   return os;
16896 }
16897 
16898 // implementations for isl::pw_aff
manage(__isl_take isl_pw_aff * ptr)16899 pw_aff manage(__isl_take isl_pw_aff *ptr) {
16900   if (!ptr)
16901     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16902   return pw_aff(ptr);
16903 }
manage_copy(__isl_keep isl_pw_aff * ptr)16904 pw_aff manage_copy(__isl_keep isl_pw_aff *ptr) {
16905   if (!ptr)
16906     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16907   auto saved_ctx = isl_pw_aff_get_ctx(ptr);
16908   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16909   ptr = isl_pw_aff_copy(ptr);
16910   if (!ptr)
16911     exception::throw_last_error(saved_ctx);
16912   return pw_aff(ptr);
16913 }
16914 
pw_aff()16915 pw_aff::pw_aff()
16916     : ptr(nullptr) {}
16917 
pw_aff(const pw_aff & obj)16918 pw_aff::pw_aff(const pw_aff &obj)
16919     : ptr(nullptr)
16920 {
16921   if (!obj.ptr)
16922     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16923   auto saved_ctx = isl_pw_aff_get_ctx(obj.ptr);
16924   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16925   ptr = obj.copy();
16926   if (!ptr)
16927     exception::throw_last_error(saved_ctx);
16928 }
16929 
pw_aff(__isl_take isl_pw_aff * ptr)16930 pw_aff::pw_aff(__isl_take isl_pw_aff *ptr)
16931     : ptr(ptr) {}
16932 
pw_aff(isl::aff aff)16933 pw_aff::pw_aff(isl::aff aff)
16934 {
16935   if (aff.is_null())
16936     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16937   auto saved_ctx = aff.ctx();
16938   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16939   auto res = isl_pw_aff_from_aff(aff.release());
16940   if (!res)
16941     exception::throw_last_error(saved_ctx);
16942   ptr = res;
16943 }
16944 
pw_aff(isl::ctx ctx,const std::string & str)16945 pw_aff::pw_aff(isl::ctx ctx, const std::string &str)
16946 {
16947   auto saved_ctx = ctx;
16948   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16949   auto res = isl_pw_aff_read_from_str(ctx.release(), str.c_str());
16950   if (!res)
16951     exception::throw_last_error(saved_ctx);
16952   ptr = res;
16953 }
16954 
16955 pw_aff &pw_aff::operator=(pw_aff obj) {
16956   std::swap(this->ptr, obj.ptr);
16957   return *this;
16958 }
16959 
~pw_aff()16960 pw_aff::~pw_aff() {
16961   if (ptr)
16962     isl_pw_aff_free(ptr);
16963 }
16964 
copy()16965 __isl_give isl_pw_aff *pw_aff::copy() const & {
16966   return isl_pw_aff_copy(ptr);
16967 }
16968 
get()16969 __isl_keep isl_pw_aff *pw_aff::get() const {
16970   return ptr;
16971 }
16972 
release()16973 __isl_give isl_pw_aff *pw_aff::release() {
16974   isl_pw_aff *tmp = ptr;
16975   ptr = nullptr;
16976   return tmp;
16977 }
16978 
is_null()16979 bool pw_aff::is_null() const {
16980   return ptr == nullptr;
16981 }
16982 
ctx()16983 isl::ctx pw_aff::ctx() const {
16984   return isl::ctx(isl_pw_aff_get_ctx(ptr));
16985 }
16986 
add(const isl::multi_pw_aff & multi2)16987 isl::multi_pw_aff pw_aff::add(const isl::multi_pw_aff &multi2) const
16988 {
16989   if (!ptr)
16990     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16991   return isl::pw_multi_aff(*this).add(multi2);
16992 }
16993 
add(const isl::multi_union_pw_aff & multi2)16994 isl::multi_union_pw_aff pw_aff::add(const isl::multi_union_pw_aff &multi2) const
16995 {
16996   if (!ptr)
16997     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16998   return isl::union_pw_aff(*this).add(multi2);
16999 }
17000 
add(isl::pw_aff pwaff2)17001 isl::pw_aff pw_aff::add(isl::pw_aff pwaff2) const
17002 {
17003   if (!ptr || pwaff2.is_null())
17004     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17005   auto saved_ctx = ctx();
17006   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17007   auto res = isl_pw_aff_add(copy(), pwaff2.release());
17008   if (!res)
17009     exception::throw_last_error(saved_ctx);
17010   return manage(res);
17011 }
17012 
add(const isl::pw_multi_aff & pma2)17013 isl::pw_multi_aff pw_aff::add(const isl::pw_multi_aff &pma2) const
17014 {
17015   if (!ptr)
17016     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17017   return isl::pw_multi_aff(*this).add(pma2);
17018 }
17019 
add(const isl::union_pw_aff & upa2)17020 isl::union_pw_aff pw_aff::add(const isl::union_pw_aff &upa2) const
17021 {
17022   if (!ptr)
17023     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17024   return isl::union_pw_aff(*this).add(upa2);
17025 }
17026 
add(const isl::union_pw_multi_aff & upma2)17027 isl::union_pw_multi_aff pw_aff::add(const isl::union_pw_multi_aff &upma2) const
17028 {
17029   if (!ptr)
17030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17031   return isl::union_pw_aff(*this).add(upma2);
17032 }
17033 
add(const isl::aff & pwaff2)17034 isl::pw_aff pw_aff::add(const isl::aff &pwaff2) const
17035 {
17036   if (!ptr)
17037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17038   return this->add(isl::pw_aff(pwaff2));
17039 }
17040 
add_constant(isl::val v)17041 isl::pw_aff pw_aff::add_constant(isl::val v) const
17042 {
17043   if (!ptr || v.is_null())
17044     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17045   auto saved_ctx = ctx();
17046   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17047   auto res = isl_pw_aff_add_constant_val(copy(), v.release());
17048   if (!res)
17049     exception::throw_last_error(saved_ctx);
17050   return manage(res);
17051 }
17052 
add_constant(long v)17053 isl::pw_aff pw_aff::add_constant(long v) const
17054 {
17055   if (!ptr)
17056     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17057   return this->add_constant(isl::val(ctx(), v));
17058 }
17059 
add_constant(const isl::multi_val & mv)17060 isl::pw_multi_aff pw_aff::add_constant(const isl::multi_val &mv) const
17061 {
17062   if (!ptr)
17063     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17064   return isl::pw_multi_aff(*this).add_constant(mv);
17065 }
17066 
apply(const isl::union_pw_multi_aff & upma2)17067 isl::union_pw_multi_aff pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
17068 {
17069   if (!ptr)
17070     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17071   return isl::union_pw_aff(*this).apply(upma2);
17072 }
17073 
as_aff()17074 isl::aff pw_aff::as_aff() const
17075 {
17076   if (!ptr)
17077     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17078   auto saved_ctx = ctx();
17079   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17080   auto res = isl_pw_aff_as_aff(copy());
17081   if (!res)
17082     exception::throw_last_error(saved_ctx);
17083   return manage(res);
17084 }
17085 
as_map()17086 isl::map pw_aff::as_map() const
17087 {
17088   if (!ptr)
17089     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17090   auto saved_ctx = ctx();
17091   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17092   auto res = isl_pw_aff_as_map(copy());
17093   if (!res)
17094     exception::throw_last_error(saved_ctx);
17095   return manage(res);
17096 }
17097 
as_multi_aff()17098 isl::multi_aff pw_aff::as_multi_aff() const
17099 {
17100   if (!ptr)
17101     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17102   return isl::pw_multi_aff(*this).as_multi_aff();
17103 }
17104 
as_multi_union_pw_aff()17105 isl::multi_union_pw_aff pw_aff::as_multi_union_pw_aff() const
17106 {
17107   if (!ptr)
17108     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17109   return isl::union_pw_aff(*this).as_multi_union_pw_aff();
17110 }
17111 
as_pw_multi_aff()17112 isl::pw_multi_aff pw_aff::as_pw_multi_aff() const
17113 {
17114   if (!ptr)
17115     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17116   return isl::union_pw_aff(*this).as_pw_multi_aff();
17117 }
17118 
as_set()17119 isl::set pw_aff::as_set() const
17120 {
17121   if (!ptr)
17122     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17123   return isl::pw_multi_aff(*this).as_set();
17124 }
17125 
as_union_map()17126 isl::union_map pw_aff::as_union_map() const
17127 {
17128   if (!ptr)
17129     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17130   return isl::union_pw_aff(*this).as_union_map();
17131 }
17132 
at(int pos)17133 isl::pw_aff pw_aff::at(int pos) const
17134 {
17135   if (!ptr)
17136     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17137   return isl::pw_multi_aff(*this).at(pos);
17138 }
17139 
bind(const isl::multi_id & tuple)17140 isl::set pw_aff::bind(const isl::multi_id &tuple) const
17141 {
17142   if (!ptr)
17143     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17144   return isl::multi_pw_aff(*this).bind(tuple);
17145 }
17146 
bind(isl::id id)17147 isl::set pw_aff::bind(isl::id id) const
17148 {
17149   if (!ptr || id.is_null())
17150     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17151   auto saved_ctx = ctx();
17152   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17153   auto res = isl_pw_aff_bind_id(copy(), id.release());
17154   if (!res)
17155     exception::throw_last_error(saved_ctx);
17156   return manage(res);
17157 }
17158 
bind(const std::string & id)17159 isl::set pw_aff::bind(const std::string &id) const
17160 {
17161   if (!ptr)
17162     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17163   return this->bind(isl::id(ctx(), id));
17164 }
17165 
bind_domain(isl::multi_id tuple)17166 isl::pw_aff pw_aff::bind_domain(isl::multi_id tuple) const
17167 {
17168   if (!ptr || tuple.is_null())
17169     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17170   auto saved_ctx = ctx();
17171   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17172   auto res = isl_pw_aff_bind_domain(copy(), tuple.release());
17173   if (!res)
17174     exception::throw_last_error(saved_ctx);
17175   return manage(res);
17176 }
17177 
bind_domain_wrapped_domain(isl::multi_id tuple)17178 isl::pw_aff pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
17179 {
17180   if (!ptr || tuple.is_null())
17181     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17182   auto saved_ctx = ctx();
17183   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17184   auto res = isl_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
17185   if (!res)
17186     exception::throw_last_error(saved_ctx);
17187   return manage(res);
17188 }
17189 
ceil()17190 isl::pw_aff pw_aff::ceil() const
17191 {
17192   if (!ptr)
17193     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17194   auto saved_ctx = ctx();
17195   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17196   auto res = isl_pw_aff_ceil(copy());
17197   if (!res)
17198     exception::throw_last_error(saved_ctx);
17199   return manage(res);
17200 }
17201 
coalesce()17202 isl::pw_aff pw_aff::coalesce() const
17203 {
17204   if (!ptr)
17205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17206   auto saved_ctx = ctx();
17207   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17208   auto res = isl_pw_aff_coalesce(copy());
17209   if (!res)
17210     exception::throw_last_error(saved_ctx);
17211   return manage(res);
17212 }
17213 
cond(isl::pw_aff pwaff_true,isl::pw_aff pwaff_false)17214 isl::pw_aff pw_aff::cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const
17215 {
17216   if (!ptr || pwaff_true.is_null() || pwaff_false.is_null())
17217     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17218   auto saved_ctx = ctx();
17219   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17220   auto res = isl_pw_aff_cond(copy(), pwaff_true.release(), pwaff_false.release());
17221   if (!res)
17222     exception::throw_last_error(saved_ctx);
17223   return manage(res);
17224 }
17225 
div(isl::pw_aff pa2)17226 isl::pw_aff pw_aff::div(isl::pw_aff pa2) const
17227 {
17228   if (!ptr || pa2.is_null())
17229     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17230   auto saved_ctx = ctx();
17231   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17232   auto res = isl_pw_aff_div(copy(), pa2.release());
17233   if (!res)
17234     exception::throw_last_error(saved_ctx);
17235   return manage(res);
17236 }
17237 
domain()17238 isl::set pw_aff::domain() const
17239 {
17240   if (!ptr)
17241     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17242   auto saved_ctx = ctx();
17243   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17244   auto res = isl_pw_aff_domain(copy());
17245   if (!res)
17246     exception::throw_last_error(saved_ctx);
17247   return manage(res);
17248 }
17249 
eq_set(isl::pw_aff pwaff2)17250 isl::set pw_aff::eq_set(isl::pw_aff pwaff2) const
17251 {
17252   if (!ptr || pwaff2.is_null())
17253     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17254   auto saved_ctx = ctx();
17255   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17256   auto res = isl_pw_aff_eq_set(copy(), pwaff2.release());
17257   if (!res)
17258     exception::throw_last_error(saved_ctx);
17259   return manage(res);
17260 }
17261 
eval(isl::point pnt)17262 isl::val pw_aff::eval(isl::point pnt) const
17263 {
17264   if (!ptr || pnt.is_null())
17265     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17266   auto saved_ctx = ctx();
17267   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17268   auto res = isl_pw_aff_eval(copy(), pnt.release());
17269   if (!res)
17270     exception::throw_last_error(saved_ctx);
17271   return manage(res);
17272 }
17273 
extract_pw_multi_aff(const isl::space & space)17274 isl::pw_multi_aff pw_aff::extract_pw_multi_aff(const isl::space &space) const
17275 {
17276   if (!ptr)
17277     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17278   return isl::union_pw_aff(*this).extract_pw_multi_aff(space);
17279 }
17280 
flat_range_product(const isl::multi_pw_aff & multi2)17281 isl::multi_pw_aff pw_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
17282 {
17283   if (!ptr)
17284     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17285   return isl::pw_multi_aff(*this).flat_range_product(multi2);
17286 }
17287 
flat_range_product(const isl::multi_union_pw_aff & multi2)17288 isl::multi_union_pw_aff pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
17289 {
17290   if (!ptr)
17291     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17292   return isl::union_pw_aff(*this).flat_range_product(multi2);
17293 }
17294 
flat_range_product(const isl::pw_multi_aff & pma2)17295 isl::pw_multi_aff pw_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
17296 {
17297   if (!ptr)
17298     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17299   return isl::pw_multi_aff(*this).flat_range_product(pma2);
17300 }
17301 
flat_range_product(const isl::union_pw_multi_aff & upma2)17302 isl::union_pw_multi_aff pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
17303 {
17304   if (!ptr)
17305     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17306   return isl::union_pw_aff(*this).flat_range_product(upma2);
17307 }
17308 
floor()17309 isl::pw_aff pw_aff::floor() const
17310 {
17311   if (!ptr)
17312     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17313   auto saved_ctx = ctx();
17314   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17315   auto res = isl_pw_aff_floor(copy());
17316   if (!res)
17317     exception::throw_last_error(saved_ctx);
17318   return manage(res);
17319 }
17320 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)17321 void pw_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
17322 {
17323   if (!ptr)
17324     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17325   return isl::pw_multi_aff(*this).foreach_piece(fn);
17326 }
17327 
ge_set(isl::pw_aff pwaff2)17328 isl::set pw_aff::ge_set(isl::pw_aff pwaff2) const
17329 {
17330   if (!ptr || pwaff2.is_null())
17331     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17332   auto saved_ctx = ctx();
17333   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17334   auto res = isl_pw_aff_ge_set(copy(), pwaff2.release());
17335   if (!res)
17336     exception::throw_last_error(saved_ctx);
17337   return manage(res);
17338 }
17339 
gist(isl::set context)17340 isl::pw_aff pw_aff::gist(isl::set context) const
17341 {
17342   if (!ptr || context.is_null())
17343     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17344   auto saved_ctx = ctx();
17345   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17346   auto res = isl_pw_aff_gist(copy(), context.release());
17347   if (!res)
17348     exception::throw_last_error(saved_ctx);
17349   return manage(res);
17350 }
17351 
gist(const isl::union_set & context)17352 isl::union_pw_aff pw_aff::gist(const isl::union_set &context) const
17353 {
17354   if (!ptr)
17355     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17356   return isl::union_pw_aff(*this).gist(context);
17357 }
17358 
gist(const isl::basic_set & context)17359 isl::pw_aff pw_aff::gist(const isl::basic_set &context) const
17360 {
17361   if (!ptr)
17362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17363   return this->gist(isl::set(context));
17364 }
17365 
gist(const isl::point & context)17366 isl::pw_aff pw_aff::gist(const isl::point &context) const
17367 {
17368   if (!ptr)
17369     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17370   return this->gist(isl::set(context));
17371 }
17372 
gt_set(isl::pw_aff pwaff2)17373 isl::set pw_aff::gt_set(isl::pw_aff pwaff2) const
17374 {
17375   if (!ptr || pwaff2.is_null())
17376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17377   auto saved_ctx = ctx();
17378   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17379   auto res = isl_pw_aff_gt_set(copy(), pwaff2.release());
17380   if (!res)
17381     exception::throw_last_error(saved_ctx);
17382   return manage(res);
17383 }
17384 
has_range_tuple_id()17385 bool pw_aff::has_range_tuple_id() const
17386 {
17387   if (!ptr)
17388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17389   return isl::pw_multi_aff(*this).has_range_tuple_id();
17390 }
17391 
identity()17392 isl::multi_pw_aff pw_aff::identity() const
17393 {
17394   if (!ptr)
17395     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17396   return isl::pw_multi_aff(*this).identity();
17397 }
17398 
insert_domain(isl::space domain)17399 isl::pw_aff pw_aff::insert_domain(isl::space domain) const
17400 {
17401   if (!ptr || domain.is_null())
17402     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17403   auto saved_ctx = ctx();
17404   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17405   auto res = isl_pw_aff_insert_domain(copy(), domain.release());
17406   if (!res)
17407     exception::throw_last_error(saved_ctx);
17408   return manage(res);
17409 }
17410 
intersect_domain(isl::set set)17411 isl::pw_aff pw_aff::intersect_domain(isl::set set) const
17412 {
17413   if (!ptr || set.is_null())
17414     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17415   auto saved_ctx = ctx();
17416   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17417   auto res = isl_pw_aff_intersect_domain(copy(), set.release());
17418   if (!res)
17419     exception::throw_last_error(saved_ctx);
17420   return manage(res);
17421 }
17422 
intersect_domain(const isl::space & space)17423 isl::union_pw_aff pw_aff::intersect_domain(const isl::space &space) const
17424 {
17425   if (!ptr)
17426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17427   return isl::union_pw_aff(*this).intersect_domain(space);
17428 }
17429 
intersect_domain(const isl::union_set & uset)17430 isl::union_pw_aff pw_aff::intersect_domain(const isl::union_set &uset) const
17431 {
17432   if (!ptr)
17433     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17434   return isl::union_pw_aff(*this).intersect_domain(uset);
17435 }
17436 
intersect_domain(const isl::basic_set & set)17437 isl::pw_aff pw_aff::intersect_domain(const isl::basic_set &set) const
17438 {
17439   if (!ptr)
17440     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17441   return this->intersect_domain(isl::set(set));
17442 }
17443 
intersect_domain(const isl::point & set)17444 isl::pw_aff pw_aff::intersect_domain(const isl::point &set) const
17445 {
17446   if (!ptr)
17447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17448   return this->intersect_domain(isl::set(set));
17449 }
17450 
intersect_domain_wrapped_domain(const isl::union_set & uset)17451 isl::union_pw_aff pw_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
17452 {
17453   if (!ptr)
17454     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17455   return isl::union_pw_aff(*this).intersect_domain_wrapped_domain(uset);
17456 }
17457 
intersect_domain_wrapped_range(const isl::union_set & uset)17458 isl::union_pw_aff pw_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
17459 {
17460   if (!ptr)
17461     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17462   return isl::union_pw_aff(*this).intersect_domain_wrapped_range(uset);
17463 }
17464 
intersect_params(isl::set set)17465 isl::pw_aff pw_aff::intersect_params(isl::set set) const
17466 {
17467   if (!ptr || set.is_null())
17468     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17469   auto saved_ctx = ctx();
17470   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17471   auto res = isl_pw_aff_intersect_params(copy(), set.release());
17472   if (!res)
17473     exception::throw_last_error(saved_ctx);
17474   return manage(res);
17475 }
17476 
involves_locals()17477 bool pw_aff::involves_locals() const
17478 {
17479   if (!ptr)
17480     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17481   return isl::pw_multi_aff(*this).involves_locals();
17482 }
17483 
involves_nan()17484 bool pw_aff::involves_nan() const
17485 {
17486   if (!ptr)
17487     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17488   return isl::multi_pw_aff(*this).involves_nan();
17489 }
17490 
involves_param(const isl::id & id)17491 bool pw_aff::involves_param(const isl::id &id) const
17492 {
17493   if (!ptr)
17494     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17495   return isl::pw_multi_aff(*this).involves_param(id);
17496 }
17497 
involves_param(const std::string & id)17498 bool pw_aff::involves_param(const std::string &id) const
17499 {
17500   if (!ptr)
17501     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17502   return this->involves_param(isl::id(ctx(), id));
17503 }
17504 
involves_param(const isl::id_list & list)17505 bool pw_aff::involves_param(const isl::id_list &list) const
17506 {
17507   if (!ptr)
17508     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17509   return isl::pw_multi_aff(*this).involves_param(list);
17510 }
17511 
isa_aff()17512 bool pw_aff::isa_aff() const
17513 {
17514   if (!ptr)
17515     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17516   auto saved_ctx = ctx();
17517   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17518   auto res = isl_pw_aff_isa_aff(get());
17519   if (res < 0)
17520     exception::throw_last_error(saved_ctx);
17521   return res;
17522 }
17523 
isa_multi_aff()17524 bool pw_aff::isa_multi_aff() const
17525 {
17526   if (!ptr)
17527     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17528   return isl::pw_multi_aff(*this).isa_multi_aff();
17529 }
17530 
isa_pw_multi_aff()17531 bool pw_aff::isa_pw_multi_aff() const
17532 {
17533   if (!ptr)
17534     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17535   return isl::union_pw_aff(*this).isa_pw_multi_aff();
17536 }
17537 
le_set(isl::pw_aff pwaff2)17538 isl::set pw_aff::le_set(isl::pw_aff pwaff2) const
17539 {
17540   if (!ptr || pwaff2.is_null())
17541     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17542   auto saved_ctx = ctx();
17543   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17544   auto res = isl_pw_aff_le_set(copy(), pwaff2.release());
17545   if (!res)
17546     exception::throw_last_error(saved_ctx);
17547   return manage(res);
17548 }
17549 
list()17550 isl::pw_aff_list pw_aff::list() const
17551 {
17552   if (!ptr)
17553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17554   return isl::multi_pw_aff(*this).list();
17555 }
17556 
lt_set(isl::pw_aff pwaff2)17557 isl::set pw_aff::lt_set(isl::pw_aff pwaff2) const
17558 {
17559   if (!ptr || pwaff2.is_null())
17560     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17561   auto saved_ctx = ctx();
17562   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17563   auto res = isl_pw_aff_lt_set(copy(), pwaff2.release());
17564   if (!res)
17565     exception::throw_last_error(saved_ctx);
17566   return manage(res);
17567 }
17568 
max(const isl::multi_pw_aff & multi2)17569 isl::multi_pw_aff pw_aff::max(const isl::multi_pw_aff &multi2) const
17570 {
17571   if (!ptr)
17572     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17573   return isl::pw_multi_aff(*this).max(multi2);
17574 }
17575 
max(isl::pw_aff pwaff2)17576 isl::pw_aff pw_aff::max(isl::pw_aff pwaff2) const
17577 {
17578   if (!ptr || pwaff2.is_null())
17579     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17580   auto saved_ctx = ctx();
17581   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17582   auto res = isl_pw_aff_max(copy(), pwaff2.release());
17583   if (!res)
17584     exception::throw_last_error(saved_ctx);
17585   return manage(res);
17586 }
17587 
max(const isl::aff & pwaff2)17588 isl::pw_aff pw_aff::max(const isl::aff &pwaff2) const
17589 {
17590   if (!ptr)
17591     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17592   return this->max(isl::pw_aff(pwaff2));
17593 }
17594 
max_multi_val()17595 isl::multi_val pw_aff::max_multi_val() const
17596 {
17597   if (!ptr)
17598     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17599   return isl::pw_multi_aff(*this).max_multi_val();
17600 }
17601 
min(const isl::multi_pw_aff & multi2)17602 isl::multi_pw_aff pw_aff::min(const isl::multi_pw_aff &multi2) const
17603 {
17604   if (!ptr)
17605     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17606   return isl::pw_multi_aff(*this).min(multi2);
17607 }
17608 
min(isl::pw_aff pwaff2)17609 isl::pw_aff pw_aff::min(isl::pw_aff pwaff2) const
17610 {
17611   if (!ptr || pwaff2.is_null())
17612     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17613   auto saved_ctx = ctx();
17614   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17615   auto res = isl_pw_aff_min(copy(), pwaff2.release());
17616   if (!res)
17617     exception::throw_last_error(saved_ctx);
17618   return manage(res);
17619 }
17620 
min(const isl::aff & pwaff2)17621 isl::pw_aff pw_aff::min(const isl::aff &pwaff2) const
17622 {
17623   if (!ptr)
17624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17625   return this->min(isl::pw_aff(pwaff2));
17626 }
17627 
min_multi_val()17628 isl::multi_val pw_aff::min_multi_val() const
17629 {
17630   if (!ptr)
17631     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17632   return isl::pw_multi_aff(*this).min_multi_val();
17633 }
17634 
mod(isl::val mod)17635 isl::pw_aff pw_aff::mod(isl::val mod) const
17636 {
17637   if (!ptr || mod.is_null())
17638     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17639   auto saved_ctx = ctx();
17640   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17641   auto res = isl_pw_aff_mod_val(copy(), mod.release());
17642   if (!res)
17643     exception::throw_last_error(saved_ctx);
17644   return manage(res);
17645 }
17646 
mod(long mod)17647 isl::pw_aff pw_aff::mod(long mod) const
17648 {
17649   if (!ptr)
17650     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17651   return this->mod(isl::val(ctx(), mod));
17652 }
17653 
mul(isl::pw_aff pwaff2)17654 isl::pw_aff pw_aff::mul(isl::pw_aff pwaff2) const
17655 {
17656   if (!ptr || pwaff2.is_null())
17657     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17658   auto saved_ctx = ctx();
17659   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17660   auto res = isl_pw_aff_mul(copy(), pwaff2.release());
17661   if (!res)
17662     exception::throw_last_error(saved_ctx);
17663   return manage(res);
17664 }
17665 
n_piece()17666 unsigned pw_aff::n_piece() const
17667 {
17668   if (!ptr)
17669     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17670   return isl::pw_multi_aff(*this).n_piece();
17671 }
17672 
ne_set(isl::pw_aff pwaff2)17673 isl::set pw_aff::ne_set(isl::pw_aff pwaff2) const
17674 {
17675   if (!ptr || pwaff2.is_null())
17676     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17677   auto saved_ctx = ctx();
17678   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17679   auto res = isl_pw_aff_ne_set(copy(), pwaff2.release());
17680   if (!res)
17681     exception::throw_last_error(saved_ctx);
17682   return manage(res);
17683 }
17684 
neg()17685 isl::pw_aff pw_aff::neg() const
17686 {
17687   if (!ptr)
17688     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17689   auto saved_ctx = ctx();
17690   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17691   auto res = isl_pw_aff_neg(copy());
17692   if (!res)
17693     exception::throw_last_error(saved_ctx);
17694   return manage(res);
17695 }
17696 
param_on_domain(isl::set domain,isl::id id)17697 isl::pw_aff pw_aff::param_on_domain(isl::set domain, isl::id id)
17698 {
17699   if (domain.is_null() || id.is_null())
17700     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17701   auto saved_ctx = domain.ctx();
17702   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17703   auto res = isl_pw_aff_param_on_domain_id(domain.release(), id.release());
17704   if (!res)
17705     exception::throw_last_error(saved_ctx);
17706   return manage(res);
17707 }
17708 
plain_is_empty()17709 bool pw_aff::plain_is_empty() const
17710 {
17711   if (!ptr)
17712     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17713   return isl::union_pw_aff(*this).plain_is_empty();
17714 }
17715 
plain_is_equal(const isl::multi_pw_aff & multi2)17716 bool pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
17717 {
17718   if (!ptr)
17719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17720   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
17721 }
17722 
plain_is_equal(const isl::multi_union_pw_aff & multi2)17723 bool pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
17724 {
17725   if (!ptr)
17726     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17727   return isl::union_pw_aff(*this).plain_is_equal(multi2);
17728 }
17729 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)17730 isl::pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
17731 {
17732   if (!ptr)
17733     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17734   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
17735 }
17736 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)17737 isl::union_pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
17738 {
17739   if (!ptr)
17740     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17741   return isl::union_pw_aff(*this).preimage_domain_wrapped_domain(upma2);
17742 }
17743 
product(const isl::multi_pw_aff & multi2)17744 isl::multi_pw_aff pw_aff::product(const isl::multi_pw_aff &multi2) const
17745 {
17746   if (!ptr)
17747     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17748   return isl::pw_multi_aff(*this).product(multi2);
17749 }
17750 
product(const isl::pw_multi_aff & pma2)17751 isl::pw_multi_aff pw_aff::product(const isl::pw_multi_aff &pma2) const
17752 {
17753   if (!ptr)
17754     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17755   return isl::pw_multi_aff(*this).product(pma2);
17756 }
17757 
pullback(isl::multi_aff ma)17758 isl::pw_aff pw_aff::pullback(isl::multi_aff ma) const
17759 {
17760   if (!ptr || ma.is_null())
17761     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17762   auto saved_ctx = ctx();
17763   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17764   auto res = isl_pw_aff_pullback_multi_aff(copy(), ma.release());
17765   if (!res)
17766     exception::throw_last_error(saved_ctx);
17767   return manage(res);
17768 }
17769 
pullback(isl::multi_pw_aff mpa)17770 isl::pw_aff pw_aff::pullback(isl::multi_pw_aff mpa) const
17771 {
17772   if (!ptr || mpa.is_null())
17773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17774   auto saved_ctx = ctx();
17775   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17776   auto res = isl_pw_aff_pullback_multi_pw_aff(copy(), mpa.release());
17777   if (!res)
17778     exception::throw_last_error(saved_ctx);
17779   return manage(res);
17780 }
17781 
pullback(isl::pw_multi_aff pma)17782 isl::pw_aff pw_aff::pullback(isl::pw_multi_aff pma) const
17783 {
17784   if (!ptr || pma.is_null())
17785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17786   auto saved_ctx = ctx();
17787   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17788   auto res = isl_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
17789   if (!res)
17790     exception::throw_last_error(saved_ctx);
17791   return manage(res);
17792 }
17793 
pullback(const isl::union_pw_multi_aff & upma)17794 isl::union_pw_aff pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
17795 {
17796   if (!ptr)
17797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17798   return isl::union_pw_aff(*this).pullback(upma);
17799 }
17800 
pw_multi_aff_list()17801 isl::pw_multi_aff_list pw_aff::pw_multi_aff_list() const
17802 {
17803   if (!ptr)
17804     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17805   return isl::union_pw_aff(*this).pw_multi_aff_list();
17806 }
17807 
range_factor_domain()17808 isl::pw_multi_aff pw_aff::range_factor_domain() const
17809 {
17810   if (!ptr)
17811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17812   return isl::pw_multi_aff(*this).range_factor_domain();
17813 }
17814 
range_factor_range()17815 isl::pw_multi_aff pw_aff::range_factor_range() const
17816 {
17817   if (!ptr)
17818     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17819   return isl::pw_multi_aff(*this).range_factor_range();
17820 }
17821 
range_product(const isl::multi_pw_aff & multi2)17822 isl::multi_pw_aff pw_aff::range_product(const isl::multi_pw_aff &multi2) const
17823 {
17824   if (!ptr)
17825     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17826   return isl::pw_multi_aff(*this).range_product(multi2);
17827 }
17828 
range_product(const isl::multi_union_pw_aff & multi2)17829 isl::multi_union_pw_aff pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
17830 {
17831   if (!ptr)
17832     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17833   return isl::union_pw_aff(*this).range_product(multi2);
17834 }
17835 
range_product(const isl::pw_multi_aff & pma2)17836 isl::pw_multi_aff pw_aff::range_product(const isl::pw_multi_aff &pma2) const
17837 {
17838   if (!ptr)
17839     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17840   return isl::pw_multi_aff(*this).range_product(pma2);
17841 }
17842 
range_product(const isl::union_pw_multi_aff & upma2)17843 isl::union_pw_multi_aff pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
17844 {
17845   if (!ptr)
17846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17847   return isl::union_pw_aff(*this).range_product(upma2);
17848 }
17849 
range_tuple_id()17850 isl::id pw_aff::range_tuple_id() const
17851 {
17852   if (!ptr)
17853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17854   return isl::pw_multi_aff(*this).range_tuple_id();
17855 }
17856 
reset_range_tuple_id()17857 isl::multi_pw_aff pw_aff::reset_range_tuple_id() const
17858 {
17859   if (!ptr)
17860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17861   return isl::multi_pw_aff(*this).reset_range_tuple_id();
17862 }
17863 
scale(const isl::multi_val & mv)17864 isl::multi_pw_aff pw_aff::scale(const isl::multi_val &mv) const
17865 {
17866   if (!ptr)
17867     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17868   return isl::multi_pw_aff(*this).scale(mv);
17869 }
17870 
scale(isl::val v)17871 isl::pw_aff pw_aff::scale(isl::val v) const
17872 {
17873   if (!ptr || v.is_null())
17874     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17875   auto saved_ctx = ctx();
17876   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17877   auto res = isl_pw_aff_scale_val(copy(), v.release());
17878   if (!res)
17879     exception::throw_last_error(saved_ctx);
17880   return manage(res);
17881 }
17882 
scale(long v)17883 isl::pw_aff pw_aff::scale(long v) const
17884 {
17885   if (!ptr)
17886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17887   return this->scale(isl::val(ctx(), v));
17888 }
17889 
scale_down(const isl::multi_val & mv)17890 isl::multi_pw_aff pw_aff::scale_down(const isl::multi_val &mv) const
17891 {
17892   if (!ptr)
17893     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17894   return isl::multi_pw_aff(*this).scale_down(mv);
17895 }
17896 
scale_down(isl::val f)17897 isl::pw_aff pw_aff::scale_down(isl::val f) const
17898 {
17899   if (!ptr || f.is_null())
17900     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17901   auto saved_ctx = ctx();
17902   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17903   auto res = isl_pw_aff_scale_down_val(copy(), f.release());
17904   if (!res)
17905     exception::throw_last_error(saved_ctx);
17906   return manage(res);
17907 }
17908 
scale_down(long f)17909 isl::pw_aff pw_aff::scale_down(long f) const
17910 {
17911   if (!ptr)
17912     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17913   return this->scale_down(isl::val(ctx(), f));
17914 }
17915 
set_at(int pos,const isl::pw_aff & el)17916 isl::multi_pw_aff pw_aff::set_at(int pos, const isl::pw_aff &el) const
17917 {
17918   if (!ptr)
17919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17920   return isl::pw_multi_aff(*this).set_at(pos, el);
17921 }
17922 
set_at(int pos,const isl::union_pw_aff & el)17923 isl::multi_union_pw_aff pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
17924 {
17925   if (!ptr)
17926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17927   return isl::union_pw_aff(*this).set_at(pos, el);
17928 }
17929 
set_range_tuple(const isl::id & id)17930 isl::pw_multi_aff pw_aff::set_range_tuple(const isl::id &id) const
17931 {
17932   if (!ptr)
17933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17934   return isl::pw_multi_aff(*this).set_range_tuple(id);
17935 }
17936 
set_range_tuple(const std::string & id)17937 isl::pw_multi_aff pw_aff::set_range_tuple(const std::string &id) const
17938 {
17939   if (!ptr)
17940     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17941   return this->set_range_tuple(isl::id(ctx(), id));
17942 }
17943 
size()17944 unsigned pw_aff::size() const
17945 {
17946   if (!ptr)
17947     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17948   return isl::multi_pw_aff(*this).size();
17949 }
17950 
space()17951 isl::space pw_aff::space() const
17952 {
17953   if (!ptr)
17954     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17955   auto saved_ctx = ctx();
17956   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17957   auto res = isl_pw_aff_get_space(get());
17958   if (!res)
17959     exception::throw_last_error(saved_ctx);
17960   return manage(res);
17961 }
17962 
get_space()17963 isl::space pw_aff::get_space() const
17964 {
17965   return space();
17966 }
17967 
sub(const isl::multi_pw_aff & multi2)17968 isl::multi_pw_aff pw_aff::sub(const isl::multi_pw_aff &multi2) const
17969 {
17970   if (!ptr)
17971     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17972   return isl::pw_multi_aff(*this).sub(multi2);
17973 }
17974 
sub(const isl::multi_union_pw_aff & multi2)17975 isl::multi_union_pw_aff pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
17976 {
17977   if (!ptr)
17978     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17979   return isl::union_pw_aff(*this).sub(multi2);
17980 }
17981 
sub(isl::pw_aff pwaff2)17982 isl::pw_aff pw_aff::sub(isl::pw_aff pwaff2) const
17983 {
17984   if (!ptr || pwaff2.is_null())
17985     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17986   auto saved_ctx = ctx();
17987   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17988   auto res = isl_pw_aff_sub(copy(), pwaff2.release());
17989   if (!res)
17990     exception::throw_last_error(saved_ctx);
17991   return manage(res);
17992 }
17993 
sub(const isl::pw_multi_aff & pma2)17994 isl::pw_multi_aff pw_aff::sub(const isl::pw_multi_aff &pma2) const
17995 {
17996   if (!ptr)
17997     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17998   return isl::pw_multi_aff(*this).sub(pma2);
17999 }
18000 
sub(const isl::union_pw_aff & upa2)18001 isl::union_pw_aff pw_aff::sub(const isl::union_pw_aff &upa2) const
18002 {
18003   if (!ptr)
18004     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18005   return isl::union_pw_aff(*this).sub(upa2);
18006 }
18007 
sub(const isl::union_pw_multi_aff & upma2)18008 isl::union_pw_multi_aff pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
18009 {
18010   if (!ptr)
18011     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18012   return isl::union_pw_aff(*this).sub(upma2);
18013 }
18014 
sub(const isl::aff & pwaff2)18015 isl::pw_aff pw_aff::sub(const isl::aff &pwaff2) const
18016 {
18017   if (!ptr)
18018     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18019   return this->sub(isl::pw_aff(pwaff2));
18020 }
18021 
subtract_domain(isl::set set)18022 isl::pw_aff pw_aff::subtract_domain(isl::set set) const
18023 {
18024   if (!ptr || set.is_null())
18025     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18026   auto saved_ctx = ctx();
18027   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18028   auto res = isl_pw_aff_subtract_domain(copy(), set.release());
18029   if (!res)
18030     exception::throw_last_error(saved_ctx);
18031   return manage(res);
18032 }
18033 
subtract_domain(const isl::space & space)18034 isl::union_pw_aff pw_aff::subtract_domain(const isl::space &space) const
18035 {
18036   if (!ptr)
18037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18038   return isl::union_pw_aff(*this).subtract_domain(space);
18039 }
18040 
subtract_domain(const isl::union_set & uset)18041 isl::union_pw_aff pw_aff::subtract_domain(const isl::union_set &uset) const
18042 {
18043   if (!ptr)
18044     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18045   return isl::union_pw_aff(*this).subtract_domain(uset);
18046 }
18047 
subtract_domain(const isl::basic_set & set)18048 isl::pw_aff pw_aff::subtract_domain(const isl::basic_set &set) const
18049 {
18050   if (!ptr)
18051     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18052   return this->subtract_domain(isl::set(set));
18053 }
18054 
subtract_domain(const isl::point & set)18055 isl::pw_aff pw_aff::subtract_domain(const isl::point &set) const
18056 {
18057   if (!ptr)
18058     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18059   return this->subtract_domain(isl::set(set));
18060 }
18061 
tdiv_q(isl::pw_aff pa2)18062 isl::pw_aff pw_aff::tdiv_q(isl::pw_aff pa2) const
18063 {
18064   if (!ptr || pa2.is_null())
18065     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18066   auto saved_ctx = ctx();
18067   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18068   auto res = isl_pw_aff_tdiv_q(copy(), pa2.release());
18069   if (!res)
18070     exception::throw_last_error(saved_ctx);
18071   return manage(res);
18072 }
18073 
tdiv_r(isl::pw_aff pa2)18074 isl::pw_aff pw_aff::tdiv_r(isl::pw_aff pa2) const
18075 {
18076   if (!ptr || pa2.is_null())
18077     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18078   auto saved_ctx = ctx();
18079   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18080   auto res = isl_pw_aff_tdiv_r(copy(), pa2.release());
18081   if (!res)
18082     exception::throw_last_error(saved_ctx);
18083   return manage(res);
18084 }
18085 
to_list()18086 isl::pw_aff_list pw_aff::to_list() const
18087 {
18088   if (!ptr)
18089     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18090   auto saved_ctx = ctx();
18091   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18092   auto res = isl_pw_aff_to_list(copy());
18093   if (!res)
18094     exception::throw_last_error(saved_ctx);
18095   return manage(res);
18096 }
18097 
to_multi_pw_aff()18098 isl::multi_pw_aff pw_aff::to_multi_pw_aff() const
18099 {
18100   if (!ptr)
18101     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18102   return isl::pw_multi_aff(*this).to_multi_pw_aff();
18103 }
18104 
to_union_pw_aff()18105 isl::union_pw_aff pw_aff::to_union_pw_aff() const
18106 {
18107   if (!ptr)
18108     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18109   auto saved_ctx = ctx();
18110   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18111   auto res = isl_pw_aff_to_union_pw_aff(copy());
18112   if (!res)
18113     exception::throw_last_error(saved_ctx);
18114   return manage(res);
18115 }
18116 
to_union_pw_multi_aff()18117 isl::union_pw_multi_aff pw_aff::to_union_pw_multi_aff() const
18118 {
18119   if (!ptr)
18120     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18121   return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
18122 }
18123 
unbind_params_insert_domain(const isl::multi_id & domain)18124 isl::multi_pw_aff pw_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
18125 {
18126   if (!ptr)
18127     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18128   return isl::pw_multi_aff(*this).unbind_params_insert_domain(domain);
18129 }
18130 
union_add(const isl::multi_pw_aff & mpa2)18131 isl::multi_pw_aff pw_aff::union_add(const isl::multi_pw_aff &mpa2) const
18132 {
18133   if (!ptr)
18134     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18135   return isl::pw_multi_aff(*this).union_add(mpa2);
18136 }
18137 
union_add(const isl::multi_union_pw_aff & mupa2)18138 isl::multi_union_pw_aff pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
18139 {
18140   if (!ptr)
18141     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18142   return isl::union_pw_aff(*this).union_add(mupa2);
18143 }
18144 
union_add(isl::pw_aff pwaff2)18145 isl::pw_aff pw_aff::union_add(isl::pw_aff pwaff2) const
18146 {
18147   if (!ptr || pwaff2.is_null())
18148     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18149   auto saved_ctx = ctx();
18150   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18151   auto res = isl_pw_aff_union_add(copy(), pwaff2.release());
18152   if (!res)
18153     exception::throw_last_error(saved_ctx);
18154   return manage(res);
18155 }
18156 
union_add(const isl::pw_multi_aff & pma2)18157 isl::pw_multi_aff pw_aff::union_add(const isl::pw_multi_aff &pma2) const
18158 {
18159   if (!ptr)
18160     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18161   return isl::pw_multi_aff(*this).union_add(pma2);
18162 }
18163 
union_add(const isl::union_pw_aff & upa2)18164 isl::union_pw_aff pw_aff::union_add(const isl::union_pw_aff &upa2) const
18165 {
18166   if (!ptr)
18167     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18168   return isl::union_pw_aff(*this).union_add(upa2);
18169 }
18170 
union_add(const isl::union_pw_multi_aff & upma2)18171 isl::union_pw_multi_aff pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
18172 {
18173   if (!ptr)
18174     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18175   return isl::union_pw_aff(*this).union_add(upma2);
18176 }
18177 
union_add(const isl::aff & pwaff2)18178 isl::pw_aff pw_aff::union_add(const isl::aff &pwaff2) const
18179 {
18180   if (!ptr)
18181     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18182   return this->union_add(isl::pw_aff(pwaff2));
18183 }
18184 
18185 inline std::ostream &operator<<(std::ostream &os, const pw_aff &obj)
18186 {
18187   if (!obj.get())
18188     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18189   auto saved_ctx = isl_pw_aff_get_ctx(obj.get());
18190   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18191   char *str = isl_pw_aff_to_str(obj.get());
18192   if (!str)
18193     exception::throw_last_error(saved_ctx);
18194   os << str;
18195   free(str);
18196   return os;
18197 }
18198 
18199 // implementations for isl::pw_aff_list
manage(__isl_take isl_pw_aff_list * ptr)18200 pw_aff_list manage(__isl_take isl_pw_aff_list *ptr) {
18201   if (!ptr)
18202     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18203   return pw_aff_list(ptr);
18204 }
manage_copy(__isl_keep isl_pw_aff_list * ptr)18205 pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr) {
18206   if (!ptr)
18207     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18208   auto saved_ctx = isl_pw_aff_list_get_ctx(ptr);
18209   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18210   ptr = isl_pw_aff_list_copy(ptr);
18211   if (!ptr)
18212     exception::throw_last_error(saved_ctx);
18213   return pw_aff_list(ptr);
18214 }
18215 
pw_aff_list()18216 pw_aff_list::pw_aff_list()
18217     : ptr(nullptr) {}
18218 
pw_aff_list(const pw_aff_list & obj)18219 pw_aff_list::pw_aff_list(const pw_aff_list &obj)
18220     : ptr(nullptr)
18221 {
18222   if (!obj.ptr)
18223     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18224   auto saved_ctx = isl_pw_aff_list_get_ctx(obj.ptr);
18225   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18226   ptr = obj.copy();
18227   if (!ptr)
18228     exception::throw_last_error(saved_ctx);
18229 }
18230 
pw_aff_list(__isl_take isl_pw_aff_list * ptr)18231 pw_aff_list::pw_aff_list(__isl_take isl_pw_aff_list *ptr)
18232     : ptr(ptr) {}
18233 
pw_aff_list(isl::ctx ctx,int n)18234 pw_aff_list::pw_aff_list(isl::ctx ctx, int n)
18235 {
18236   auto saved_ctx = ctx;
18237   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18238   auto res = isl_pw_aff_list_alloc(ctx.release(), n);
18239   if (!res)
18240     exception::throw_last_error(saved_ctx);
18241   ptr = res;
18242 }
18243 
pw_aff_list(isl::pw_aff el)18244 pw_aff_list::pw_aff_list(isl::pw_aff el)
18245 {
18246   if (el.is_null())
18247     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18248   auto saved_ctx = el.ctx();
18249   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18250   auto res = isl_pw_aff_list_from_pw_aff(el.release());
18251   if (!res)
18252     exception::throw_last_error(saved_ctx);
18253   ptr = res;
18254 }
18255 
pw_aff_list(isl::ctx ctx,const std::string & str)18256 pw_aff_list::pw_aff_list(isl::ctx ctx, const std::string &str)
18257 {
18258   auto saved_ctx = ctx;
18259   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18260   auto res = isl_pw_aff_list_read_from_str(ctx.release(), str.c_str());
18261   if (!res)
18262     exception::throw_last_error(saved_ctx);
18263   ptr = res;
18264 }
18265 
18266 pw_aff_list &pw_aff_list::operator=(pw_aff_list obj) {
18267   std::swap(this->ptr, obj.ptr);
18268   return *this;
18269 }
18270 
~pw_aff_list()18271 pw_aff_list::~pw_aff_list() {
18272   if (ptr)
18273     isl_pw_aff_list_free(ptr);
18274 }
18275 
copy()18276 __isl_give isl_pw_aff_list *pw_aff_list::copy() const & {
18277   return isl_pw_aff_list_copy(ptr);
18278 }
18279 
get()18280 __isl_keep isl_pw_aff_list *pw_aff_list::get() const {
18281   return ptr;
18282 }
18283 
release()18284 __isl_give isl_pw_aff_list *pw_aff_list::release() {
18285   isl_pw_aff_list *tmp = ptr;
18286   ptr = nullptr;
18287   return tmp;
18288 }
18289 
is_null()18290 bool pw_aff_list::is_null() const {
18291   return ptr == nullptr;
18292 }
18293 
ctx()18294 isl::ctx pw_aff_list::ctx() const {
18295   return isl::ctx(isl_pw_aff_list_get_ctx(ptr));
18296 }
18297 
add(isl::pw_aff el)18298 isl::pw_aff_list pw_aff_list::add(isl::pw_aff el) const
18299 {
18300   if (!ptr || el.is_null())
18301     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18302   auto saved_ctx = ctx();
18303   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18304   auto res = isl_pw_aff_list_add(copy(), el.release());
18305   if (!res)
18306     exception::throw_last_error(saved_ctx);
18307   return manage(res);
18308 }
18309 
at(int index)18310 isl::pw_aff pw_aff_list::at(int index) const
18311 {
18312   if (!ptr)
18313     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18314   auto saved_ctx = ctx();
18315   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18316   auto res = isl_pw_aff_list_get_at(get(), index);
18317   if (!res)
18318     exception::throw_last_error(saved_ctx);
18319   return manage(res);
18320 }
18321 
get_at(int index)18322 isl::pw_aff pw_aff_list::get_at(int index) const
18323 {
18324   return at(index);
18325 }
18326 
clear()18327 isl::pw_aff_list pw_aff_list::clear() const
18328 {
18329   if (!ptr)
18330     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18331   auto saved_ctx = ctx();
18332   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18333   auto res = isl_pw_aff_list_clear(copy());
18334   if (!res)
18335     exception::throw_last_error(saved_ctx);
18336   return manage(res);
18337 }
18338 
concat(isl::pw_aff_list list2)18339 isl::pw_aff_list pw_aff_list::concat(isl::pw_aff_list list2) const
18340 {
18341   if (!ptr || list2.is_null())
18342     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18343   auto saved_ctx = ctx();
18344   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18345   auto res = isl_pw_aff_list_concat(copy(), list2.release());
18346   if (!res)
18347     exception::throw_last_error(saved_ctx);
18348   return manage(res);
18349 }
18350 
drop(unsigned int first,unsigned int n)18351 isl::pw_aff_list pw_aff_list::drop(unsigned int first, unsigned int n) const
18352 {
18353   if (!ptr)
18354     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18355   auto saved_ctx = ctx();
18356   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18357   auto res = isl_pw_aff_list_drop(copy(), first, n);
18358   if (!res)
18359     exception::throw_last_error(saved_ctx);
18360   return manage(res);
18361 }
18362 
foreach(const std::function<void (isl::pw_aff)> & fn)18363 void pw_aff_list::foreach(const std::function<void(isl::pw_aff)> &fn) const
18364 {
18365   if (!ptr)
18366     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18367   auto saved_ctx = ctx();
18368   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18369   struct fn_data {
18370     std::function<void(isl::pw_aff)> func;
18371     std::exception_ptr eptr;
18372   } fn_data = { fn };
18373   auto fn_lambda = [](isl_pw_aff *arg_0, void *arg_1) -> isl_stat {
18374     auto *data = static_cast<struct fn_data *>(arg_1);
18375     ISL_CPP_TRY {
18376       (data->func)(manage(arg_0));
18377       return isl_stat_ok;
18378     } ISL_CPP_CATCH_ALL {
18379       data->eptr = std::current_exception();
18380       return isl_stat_error;
18381     }
18382   };
18383   auto res = isl_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
18384   if (fn_data.eptr)
18385     std::rethrow_exception(fn_data.eptr);
18386   if (res < 0)
18387     exception::throw_last_error(saved_ctx);
18388   return;
18389 }
18390 
insert(unsigned int pos,isl::pw_aff el)18391 isl::pw_aff_list pw_aff_list::insert(unsigned int pos, isl::pw_aff el) const
18392 {
18393   if (!ptr || el.is_null())
18394     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18395   auto saved_ctx = ctx();
18396   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18397   auto res = isl_pw_aff_list_insert(copy(), pos, el.release());
18398   if (!res)
18399     exception::throw_last_error(saved_ctx);
18400   return manage(res);
18401 }
18402 
size()18403 unsigned pw_aff_list::size() const
18404 {
18405   if (!ptr)
18406     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18407   auto saved_ctx = ctx();
18408   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18409   auto res = isl_pw_aff_list_size(get());
18410   if (res < 0)
18411     exception::throw_last_error(saved_ctx);
18412   return res;
18413 }
18414 
18415 inline std::ostream &operator<<(std::ostream &os, const pw_aff_list &obj)
18416 {
18417   if (!obj.get())
18418     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18419   auto saved_ctx = isl_pw_aff_list_get_ctx(obj.get());
18420   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18421   char *str = isl_pw_aff_list_to_str(obj.get());
18422   if (!str)
18423     exception::throw_last_error(saved_ctx);
18424   os << str;
18425   free(str);
18426   return os;
18427 }
18428 
18429 // implementations for isl::pw_multi_aff
manage(__isl_take isl_pw_multi_aff * ptr)18430 pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr) {
18431   if (!ptr)
18432     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18433   return pw_multi_aff(ptr);
18434 }
manage_copy(__isl_keep isl_pw_multi_aff * ptr)18435 pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr) {
18436   if (!ptr)
18437     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18438   auto saved_ctx = isl_pw_multi_aff_get_ctx(ptr);
18439   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18440   ptr = isl_pw_multi_aff_copy(ptr);
18441   if (!ptr)
18442     exception::throw_last_error(saved_ctx);
18443   return pw_multi_aff(ptr);
18444 }
18445 
pw_multi_aff()18446 pw_multi_aff::pw_multi_aff()
18447     : ptr(nullptr) {}
18448 
pw_multi_aff(const pw_multi_aff & obj)18449 pw_multi_aff::pw_multi_aff(const pw_multi_aff &obj)
18450     : ptr(nullptr)
18451 {
18452   if (!obj.ptr)
18453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18454   auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.ptr);
18455   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18456   ptr = obj.copy();
18457   if (!ptr)
18458     exception::throw_last_error(saved_ctx);
18459 }
18460 
pw_multi_aff(__isl_take isl_pw_multi_aff * ptr)18461 pw_multi_aff::pw_multi_aff(__isl_take isl_pw_multi_aff *ptr)
18462     : ptr(ptr) {}
18463 
pw_multi_aff(isl::multi_aff ma)18464 pw_multi_aff::pw_multi_aff(isl::multi_aff ma)
18465 {
18466   if (ma.is_null())
18467     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18468   auto saved_ctx = ma.ctx();
18469   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18470   auto res = isl_pw_multi_aff_from_multi_aff(ma.release());
18471   if (!res)
18472     exception::throw_last_error(saved_ctx);
18473   ptr = res;
18474 }
18475 
pw_multi_aff(isl::pw_aff pa)18476 pw_multi_aff::pw_multi_aff(isl::pw_aff pa)
18477 {
18478   if (pa.is_null())
18479     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18480   auto saved_ctx = pa.ctx();
18481   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18482   auto res = isl_pw_multi_aff_from_pw_aff(pa.release());
18483   if (!res)
18484     exception::throw_last_error(saved_ctx);
18485   ptr = res;
18486 }
18487 
pw_multi_aff(isl::ctx ctx,const std::string & str)18488 pw_multi_aff::pw_multi_aff(isl::ctx ctx, const std::string &str)
18489 {
18490   auto saved_ctx = ctx;
18491   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18492   auto res = isl_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
18493   if (!res)
18494     exception::throw_last_error(saved_ctx);
18495   ptr = res;
18496 }
18497 
18498 pw_multi_aff &pw_multi_aff::operator=(pw_multi_aff obj) {
18499   std::swap(this->ptr, obj.ptr);
18500   return *this;
18501 }
18502 
~pw_multi_aff()18503 pw_multi_aff::~pw_multi_aff() {
18504   if (ptr)
18505     isl_pw_multi_aff_free(ptr);
18506 }
18507 
copy()18508 __isl_give isl_pw_multi_aff *pw_multi_aff::copy() const & {
18509   return isl_pw_multi_aff_copy(ptr);
18510 }
18511 
get()18512 __isl_keep isl_pw_multi_aff *pw_multi_aff::get() const {
18513   return ptr;
18514 }
18515 
release()18516 __isl_give isl_pw_multi_aff *pw_multi_aff::release() {
18517   isl_pw_multi_aff *tmp = ptr;
18518   ptr = nullptr;
18519   return tmp;
18520 }
18521 
is_null()18522 bool pw_multi_aff::is_null() const {
18523   return ptr == nullptr;
18524 }
18525 
ctx()18526 isl::ctx pw_multi_aff::ctx() const {
18527   return isl::ctx(isl_pw_multi_aff_get_ctx(ptr));
18528 }
18529 
add(const isl::multi_pw_aff & multi2)18530 isl::multi_pw_aff pw_multi_aff::add(const isl::multi_pw_aff &multi2) const
18531 {
18532   if (!ptr)
18533     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18534   return isl::multi_pw_aff(*this).add(multi2);
18535 }
18536 
add(const isl::multi_union_pw_aff & multi2)18537 isl::multi_union_pw_aff pw_multi_aff::add(const isl::multi_union_pw_aff &multi2) const
18538 {
18539   if (!ptr)
18540     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18541   return isl::multi_pw_aff(*this).add(multi2);
18542 }
18543 
add(isl::pw_multi_aff pma2)18544 isl::pw_multi_aff pw_multi_aff::add(isl::pw_multi_aff pma2) const
18545 {
18546   if (!ptr || pma2.is_null())
18547     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18548   auto saved_ctx = ctx();
18549   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18550   auto res = isl_pw_multi_aff_add(copy(), pma2.release());
18551   if (!res)
18552     exception::throw_last_error(saved_ctx);
18553   return manage(res);
18554 }
18555 
add(const isl::union_pw_multi_aff & upma2)18556 isl::union_pw_multi_aff pw_multi_aff::add(const isl::union_pw_multi_aff &upma2) const
18557 {
18558   if (!ptr)
18559     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18560   return isl::union_pw_multi_aff(*this).add(upma2);
18561 }
18562 
add(const isl::multi_aff & pma2)18563 isl::pw_multi_aff pw_multi_aff::add(const isl::multi_aff &pma2) const
18564 {
18565   if (!ptr)
18566     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18567   return this->add(isl::pw_multi_aff(pma2));
18568 }
18569 
add(const isl::pw_aff & pma2)18570 isl::pw_multi_aff pw_multi_aff::add(const isl::pw_aff &pma2) const
18571 {
18572   if (!ptr)
18573     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18574   return this->add(isl::pw_multi_aff(pma2));
18575 }
18576 
add_constant(isl::multi_val mv)18577 isl::pw_multi_aff pw_multi_aff::add_constant(isl::multi_val mv) const
18578 {
18579   if (!ptr || mv.is_null())
18580     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18581   auto saved_ctx = ctx();
18582   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18583   auto res = isl_pw_multi_aff_add_constant_multi_val(copy(), mv.release());
18584   if (!res)
18585     exception::throw_last_error(saved_ctx);
18586   return manage(res);
18587 }
18588 
add_constant(isl::val v)18589 isl::pw_multi_aff pw_multi_aff::add_constant(isl::val v) const
18590 {
18591   if (!ptr || v.is_null())
18592     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18593   auto saved_ctx = ctx();
18594   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18595   auto res = isl_pw_multi_aff_add_constant_val(copy(), v.release());
18596   if (!res)
18597     exception::throw_last_error(saved_ctx);
18598   return manage(res);
18599 }
18600 
add_constant(long v)18601 isl::pw_multi_aff pw_multi_aff::add_constant(long v) const
18602 {
18603   if (!ptr)
18604     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18605   return this->add_constant(isl::val(ctx(), v));
18606 }
18607 
apply(const isl::union_pw_multi_aff & upma2)18608 isl::union_pw_multi_aff pw_multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
18609 {
18610   if (!ptr)
18611     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18612   return isl::union_pw_multi_aff(*this).apply(upma2);
18613 }
18614 
as_map()18615 isl::map pw_multi_aff::as_map() const
18616 {
18617   if (!ptr)
18618     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18619   auto saved_ctx = ctx();
18620   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18621   auto res = isl_pw_multi_aff_as_map(copy());
18622   if (!res)
18623     exception::throw_last_error(saved_ctx);
18624   return manage(res);
18625 }
18626 
as_multi_aff()18627 isl::multi_aff pw_multi_aff::as_multi_aff() const
18628 {
18629   if (!ptr)
18630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18631   auto saved_ctx = ctx();
18632   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18633   auto res = isl_pw_multi_aff_as_multi_aff(copy());
18634   if (!res)
18635     exception::throw_last_error(saved_ctx);
18636   return manage(res);
18637 }
18638 
as_multi_union_pw_aff()18639 isl::multi_union_pw_aff pw_multi_aff::as_multi_union_pw_aff() const
18640 {
18641   if (!ptr)
18642     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18643   return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
18644 }
18645 
as_pw_multi_aff()18646 isl::pw_multi_aff pw_multi_aff::as_pw_multi_aff() const
18647 {
18648   if (!ptr)
18649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18650   return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
18651 }
18652 
as_set()18653 isl::set pw_multi_aff::as_set() const
18654 {
18655   if (!ptr)
18656     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18657   auto saved_ctx = ctx();
18658   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18659   auto res = isl_pw_multi_aff_as_set(copy());
18660   if (!res)
18661     exception::throw_last_error(saved_ctx);
18662   return manage(res);
18663 }
18664 
as_union_map()18665 isl::union_map pw_multi_aff::as_union_map() const
18666 {
18667   if (!ptr)
18668     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18669   return isl::union_pw_multi_aff(*this).as_union_map();
18670 }
18671 
at(int pos)18672 isl::pw_aff pw_multi_aff::at(int pos) const
18673 {
18674   if (!ptr)
18675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18676   auto saved_ctx = ctx();
18677   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18678   auto res = isl_pw_multi_aff_get_at(get(), pos);
18679   if (!res)
18680     exception::throw_last_error(saved_ctx);
18681   return manage(res);
18682 }
18683 
get_at(int pos)18684 isl::pw_aff pw_multi_aff::get_at(int pos) const
18685 {
18686   return at(pos);
18687 }
18688 
bind(const isl::multi_id & tuple)18689 isl::set pw_multi_aff::bind(const isl::multi_id &tuple) const
18690 {
18691   if (!ptr)
18692     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18693   return isl::multi_pw_aff(*this).bind(tuple);
18694 }
18695 
bind_domain(isl::multi_id tuple)18696 isl::pw_multi_aff pw_multi_aff::bind_domain(isl::multi_id tuple) const
18697 {
18698   if (!ptr || tuple.is_null())
18699     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18700   auto saved_ctx = ctx();
18701   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18702   auto res = isl_pw_multi_aff_bind_domain(copy(), tuple.release());
18703   if (!res)
18704     exception::throw_last_error(saved_ctx);
18705   return manage(res);
18706 }
18707 
bind_domain_wrapped_domain(isl::multi_id tuple)18708 isl::pw_multi_aff pw_multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
18709 {
18710   if (!ptr || tuple.is_null())
18711     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18712   auto saved_ctx = ctx();
18713   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18714   auto res = isl_pw_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
18715   if (!res)
18716     exception::throw_last_error(saved_ctx);
18717   return manage(res);
18718 }
18719 
coalesce()18720 isl::pw_multi_aff pw_multi_aff::coalesce() const
18721 {
18722   if (!ptr)
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_multi_aff_coalesce(copy());
18727   if (!res)
18728     exception::throw_last_error(saved_ctx);
18729   return manage(res);
18730 }
18731 
domain()18732 isl::set pw_multi_aff::domain() const
18733 {
18734   if (!ptr)
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_multi_aff_domain(copy());
18739   if (!res)
18740     exception::throw_last_error(saved_ctx);
18741   return manage(res);
18742 }
18743 
domain_map(isl::space space)18744 isl::pw_multi_aff pw_multi_aff::domain_map(isl::space space)
18745 {
18746   if (space.is_null())
18747     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18748   auto saved_ctx = space.ctx();
18749   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18750   auto res = isl_pw_multi_aff_domain_map(space.release());
18751   if (!res)
18752     exception::throw_last_error(saved_ctx);
18753   return manage(res);
18754 }
18755 
extract_pw_multi_aff(const isl::space & space)18756 isl::pw_multi_aff pw_multi_aff::extract_pw_multi_aff(const isl::space &space) const
18757 {
18758   if (!ptr)
18759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18760   return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
18761 }
18762 
flat_range_product(const isl::multi_pw_aff & multi2)18763 isl::multi_pw_aff pw_multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
18764 {
18765   if (!ptr)
18766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18767   return isl::multi_pw_aff(*this).flat_range_product(multi2);
18768 }
18769 
flat_range_product(const isl::multi_union_pw_aff & multi2)18770 isl::multi_union_pw_aff pw_multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
18771 {
18772   if (!ptr)
18773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18774   return isl::multi_pw_aff(*this).flat_range_product(multi2);
18775 }
18776 
flat_range_product(isl::pw_multi_aff pma2)18777 isl::pw_multi_aff pw_multi_aff::flat_range_product(isl::pw_multi_aff pma2) const
18778 {
18779   if (!ptr || pma2.is_null())
18780     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18781   auto saved_ctx = ctx();
18782   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18783   auto res = isl_pw_multi_aff_flat_range_product(copy(), pma2.release());
18784   if (!res)
18785     exception::throw_last_error(saved_ctx);
18786   return manage(res);
18787 }
18788 
flat_range_product(const isl::union_pw_multi_aff & upma2)18789 isl::union_pw_multi_aff pw_multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
18790 {
18791   if (!ptr)
18792     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18793   return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
18794 }
18795 
flat_range_product(const isl::multi_aff & pma2)18796 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::multi_aff &pma2) const
18797 {
18798   if (!ptr)
18799     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18800   return this->flat_range_product(isl::pw_multi_aff(pma2));
18801 }
18802 
flat_range_product(const isl::pw_aff & pma2)18803 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::pw_aff &pma2) const
18804 {
18805   if (!ptr)
18806     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18807   return this->flat_range_product(isl::pw_multi_aff(pma2));
18808 }
18809 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)18810 void pw_multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
18811 {
18812   if (!ptr)
18813     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18814   auto saved_ctx = ctx();
18815   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18816   struct fn_data {
18817     std::function<void(isl::set, isl::multi_aff)> func;
18818     std::exception_ptr eptr;
18819   } fn_data = { fn };
18820   auto fn_lambda = [](isl_set *arg_0, isl_multi_aff *arg_1, void *arg_2) -> isl_stat {
18821     auto *data = static_cast<struct fn_data *>(arg_2);
18822     ISL_CPP_TRY {
18823       (data->func)(manage(arg_0), manage(arg_1));
18824       return isl_stat_ok;
18825     } ISL_CPP_CATCH_ALL {
18826       data->eptr = std::current_exception();
18827       return isl_stat_error;
18828     }
18829   };
18830   auto res = isl_pw_multi_aff_foreach_piece(get(), fn_lambda, &fn_data);
18831   if (fn_data.eptr)
18832     std::rethrow_exception(fn_data.eptr);
18833   if (res < 0)
18834     exception::throw_last_error(saved_ctx);
18835   return;
18836 }
18837 
gist(isl::set set)18838 isl::pw_multi_aff pw_multi_aff::gist(isl::set set) const
18839 {
18840   if (!ptr || set.is_null())
18841     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18842   auto saved_ctx = ctx();
18843   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18844   auto res = isl_pw_multi_aff_gist(copy(), set.release());
18845   if (!res)
18846     exception::throw_last_error(saved_ctx);
18847   return manage(res);
18848 }
18849 
gist(const isl::union_set & context)18850 isl::union_pw_multi_aff pw_multi_aff::gist(const isl::union_set &context) const
18851 {
18852   if (!ptr)
18853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18854   return isl::union_pw_multi_aff(*this).gist(context);
18855 }
18856 
gist(const isl::basic_set & set)18857 isl::pw_multi_aff pw_multi_aff::gist(const isl::basic_set &set) const
18858 {
18859   if (!ptr)
18860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18861   return this->gist(isl::set(set));
18862 }
18863 
gist(const isl::point & set)18864 isl::pw_multi_aff pw_multi_aff::gist(const isl::point &set) const
18865 {
18866   if (!ptr)
18867     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18868   return this->gist(isl::set(set));
18869 }
18870 
has_range_tuple_id()18871 bool pw_multi_aff::has_range_tuple_id() 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_multi_aff_has_range_tuple_id(get());
18878   if (res < 0)
18879     exception::throw_last_error(saved_ctx);
18880   return res;
18881 }
18882 
identity()18883 isl::multi_pw_aff pw_multi_aff::identity() const
18884 {
18885   if (!ptr)
18886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18887   return isl::multi_pw_aff(*this).identity();
18888 }
18889 
identity_on_domain(isl::space space)18890 isl::pw_multi_aff pw_multi_aff::identity_on_domain(isl::space space)
18891 {
18892   if (space.is_null())
18893     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18894   auto saved_ctx = space.ctx();
18895   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18896   auto res = isl_pw_multi_aff_identity_on_domain_space(space.release());
18897   if (!res)
18898     exception::throw_last_error(saved_ctx);
18899   return manage(res);
18900 }
18901 
insert_domain(isl::space domain)18902 isl::pw_multi_aff pw_multi_aff::insert_domain(isl::space domain) const
18903 {
18904   if (!ptr || domain.is_null())
18905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18906   auto saved_ctx = ctx();
18907   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18908   auto res = isl_pw_multi_aff_insert_domain(copy(), domain.release());
18909   if (!res)
18910     exception::throw_last_error(saved_ctx);
18911   return manage(res);
18912 }
18913 
intersect_domain(isl::set set)18914 isl::pw_multi_aff pw_multi_aff::intersect_domain(isl::set set) const
18915 {
18916   if (!ptr || set.is_null())
18917     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18918   auto saved_ctx = ctx();
18919   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18920   auto res = isl_pw_multi_aff_intersect_domain(copy(), set.release());
18921   if (!res)
18922     exception::throw_last_error(saved_ctx);
18923   return manage(res);
18924 }
18925 
intersect_domain(const isl::space & space)18926 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::space &space) const
18927 {
18928   if (!ptr)
18929     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18930   return isl::union_pw_multi_aff(*this).intersect_domain(space);
18931 }
18932 
intersect_domain(const isl::union_set & uset)18933 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::union_set &uset) const
18934 {
18935   if (!ptr)
18936     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18937   return isl::union_pw_multi_aff(*this).intersect_domain(uset);
18938 }
18939 
intersect_domain(const isl::basic_set & set)18940 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::basic_set &set) const
18941 {
18942   if (!ptr)
18943     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18944   return this->intersect_domain(isl::set(set));
18945 }
18946 
intersect_domain(const isl::point & set)18947 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::point &set) const
18948 {
18949   if (!ptr)
18950     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18951   return this->intersect_domain(isl::set(set));
18952 }
18953 
intersect_domain_wrapped_domain(const isl::union_set & uset)18954 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
18955 {
18956   if (!ptr)
18957     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18958   return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
18959 }
18960 
intersect_domain_wrapped_range(const isl::union_set & uset)18961 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
18962 {
18963   if (!ptr)
18964     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18965   return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
18966 }
18967 
intersect_params(isl::set set)18968 isl::pw_multi_aff pw_multi_aff::intersect_params(isl::set set) const
18969 {
18970   if (!ptr || set.is_null())
18971     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18972   auto saved_ctx = ctx();
18973   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18974   auto res = isl_pw_multi_aff_intersect_params(copy(), set.release());
18975   if (!res)
18976     exception::throw_last_error(saved_ctx);
18977   return manage(res);
18978 }
18979 
involves_locals()18980 bool pw_multi_aff::involves_locals() const
18981 {
18982   if (!ptr)
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_multi_aff_involves_locals(get());
18987   if (res < 0)
18988     exception::throw_last_error(saved_ctx);
18989   return res;
18990 }
18991 
involves_nan()18992 bool pw_multi_aff::involves_nan() const
18993 {
18994   if (!ptr)
18995     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18996   return isl::multi_pw_aff(*this).involves_nan();
18997 }
18998 
involves_param(const isl::id & id)18999 bool pw_multi_aff::involves_param(const isl::id &id) const
19000 {
19001   if (!ptr)
19002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19003   return isl::multi_pw_aff(*this).involves_param(id);
19004 }
19005 
involves_param(const std::string & id)19006 bool pw_multi_aff::involves_param(const std::string &id) const
19007 {
19008   if (!ptr)
19009     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19010   return this->involves_param(isl::id(ctx(), id));
19011 }
19012 
involves_param(const isl::id_list & list)19013 bool pw_multi_aff::involves_param(const isl::id_list &list) const
19014 {
19015   if (!ptr)
19016     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19017   return isl::multi_pw_aff(*this).involves_param(list);
19018 }
19019 
isa_multi_aff()19020 bool pw_multi_aff::isa_multi_aff() const
19021 {
19022   if (!ptr)
19023     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19024   auto saved_ctx = ctx();
19025   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19026   auto res = isl_pw_multi_aff_isa_multi_aff(get());
19027   if (res < 0)
19028     exception::throw_last_error(saved_ctx);
19029   return res;
19030 }
19031 
isa_pw_multi_aff()19032 bool pw_multi_aff::isa_pw_multi_aff() const
19033 {
19034   if (!ptr)
19035     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19036   return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
19037 }
19038 
list()19039 isl::pw_aff_list pw_multi_aff::list() const
19040 {
19041   if (!ptr)
19042     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19043   return isl::multi_pw_aff(*this).list();
19044 }
19045 
max(const isl::multi_pw_aff & multi2)19046 isl::multi_pw_aff pw_multi_aff::max(const isl::multi_pw_aff &multi2) const
19047 {
19048   if (!ptr)
19049     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19050   return isl::multi_pw_aff(*this).max(multi2);
19051 }
19052 
max_multi_val()19053 isl::multi_val pw_multi_aff::max_multi_val() const
19054 {
19055   if (!ptr)
19056     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19057   auto saved_ctx = ctx();
19058   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19059   auto res = isl_pw_multi_aff_max_multi_val(copy());
19060   if (!res)
19061     exception::throw_last_error(saved_ctx);
19062   return manage(res);
19063 }
19064 
min(const isl::multi_pw_aff & multi2)19065 isl::multi_pw_aff pw_multi_aff::min(const isl::multi_pw_aff &multi2) const
19066 {
19067   if (!ptr)
19068     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19069   return isl::multi_pw_aff(*this).min(multi2);
19070 }
19071 
min_multi_val()19072 isl::multi_val pw_multi_aff::min_multi_val() const
19073 {
19074   if (!ptr)
19075     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19076   auto saved_ctx = ctx();
19077   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19078   auto res = isl_pw_multi_aff_min_multi_val(copy());
19079   if (!res)
19080     exception::throw_last_error(saved_ctx);
19081   return manage(res);
19082 }
19083 
multi_val_on_domain(isl::set domain,isl::multi_val mv)19084 isl::pw_multi_aff pw_multi_aff::multi_val_on_domain(isl::set domain, isl::multi_val mv)
19085 {
19086   if (domain.is_null() || mv.is_null())
19087     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19088   auto saved_ctx = domain.ctx();
19089   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19090   auto res = isl_pw_multi_aff_multi_val_on_domain(domain.release(), mv.release());
19091   if (!res)
19092     exception::throw_last_error(saved_ctx);
19093   return manage(res);
19094 }
19095 
n_piece()19096 unsigned pw_multi_aff::n_piece() const
19097 {
19098   if (!ptr)
19099     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19100   auto saved_ctx = ctx();
19101   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19102   auto res = isl_pw_multi_aff_n_piece(get());
19103   if (res < 0)
19104     exception::throw_last_error(saved_ctx);
19105   return res;
19106 }
19107 
neg()19108 isl::multi_pw_aff pw_multi_aff::neg() const
19109 {
19110   if (!ptr)
19111     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19112   return isl::multi_pw_aff(*this).neg();
19113 }
19114 
plain_is_empty()19115 bool pw_multi_aff::plain_is_empty() const
19116 {
19117   if (!ptr)
19118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19119   return isl::union_pw_multi_aff(*this).plain_is_empty();
19120 }
19121 
plain_is_equal(const isl::multi_pw_aff & multi2)19122 bool pw_multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
19123 {
19124   if (!ptr)
19125     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19126   return isl::multi_pw_aff(*this).plain_is_equal(multi2);
19127 }
19128 
plain_is_equal(const isl::multi_union_pw_aff & multi2)19129 bool pw_multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
19130 {
19131   if (!ptr)
19132     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19133   return isl::multi_pw_aff(*this).plain_is_equal(multi2);
19134 }
19135 
preimage_domain_wrapped_domain(isl::pw_multi_aff pma2)19136 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const
19137 {
19138   if (!ptr || pma2.is_null())
19139     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19140   auto saved_ctx = ctx();
19141   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19142   auto res = isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff(copy(), pma2.release());
19143   if (!res)
19144     exception::throw_last_error(saved_ctx);
19145   return manage(res);
19146 }
19147 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)19148 isl::union_pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
19149 {
19150   if (!ptr)
19151     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19152   return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
19153 }
19154 
preimage_domain_wrapped_domain(const isl::multi_aff & pma2)19155 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const
19156 {
19157   if (!ptr)
19158     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19159   return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
19160 }
19161 
preimage_domain_wrapped_domain(const isl::pw_aff & pma2)19162 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const
19163 {
19164   if (!ptr)
19165     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19166   return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
19167 }
19168 
product(const isl::multi_pw_aff & multi2)19169 isl::multi_pw_aff pw_multi_aff::product(const isl::multi_pw_aff &multi2) const
19170 {
19171   if (!ptr)
19172     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19173   return isl::multi_pw_aff(*this).product(multi2);
19174 }
19175 
product(isl::pw_multi_aff pma2)19176 isl::pw_multi_aff pw_multi_aff::product(isl::pw_multi_aff pma2) const
19177 {
19178   if (!ptr || pma2.is_null())
19179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19180   auto saved_ctx = ctx();
19181   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19182   auto res = isl_pw_multi_aff_product(copy(), pma2.release());
19183   if (!res)
19184     exception::throw_last_error(saved_ctx);
19185   return manage(res);
19186 }
19187 
product(const isl::multi_aff & pma2)19188 isl::pw_multi_aff pw_multi_aff::product(const isl::multi_aff &pma2) const
19189 {
19190   if (!ptr)
19191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19192   return this->product(isl::pw_multi_aff(pma2));
19193 }
19194 
product(const isl::pw_aff & pma2)19195 isl::pw_multi_aff pw_multi_aff::product(const isl::pw_aff &pma2) const
19196 {
19197   if (!ptr)
19198     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19199   return this->product(isl::pw_multi_aff(pma2));
19200 }
19201 
pullback(const isl::multi_pw_aff & mpa2)19202 isl::multi_pw_aff pw_multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
19203 {
19204   if (!ptr)
19205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19206   return isl::multi_pw_aff(*this).pullback(mpa2);
19207 }
19208 
pullback(isl::multi_aff ma)19209 isl::pw_multi_aff pw_multi_aff::pullback(isl::multi_aff ma) const
19210 {
19211   if (!ptr || ma.is_null())
19212     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19213   auto saved_ctx = ctx();
19214   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19215   auto res = isl_pw_multi_aff_pullback_multi_aff(copy(), ma.release());
19216   if (!res)
19217     exception::throw_last_error(saved_ctx);
19218   return manage(res);
19219 }
19220 
pullback(isl::pw_multi_aff pma2)19221 isl::pw_multi_aff pw_multi_aff::pullback(isl::pw_multi_aff pma2) const
19222 {
19223   if (!ptr || pma2.is_null())
19224     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19225   auto saved_ctx = ctx();
19226   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19227   auto res = isl_pw_multi_aff_pullback_pw_multi_aff(copy(), pma2.release());
19228   if (!res)
19229     exception::throw_last_error(saved_ctx);
19230   return manage(res);
19231 }
19232 
pullback(const isl::union_pw_multi_aff & upma2)19233 isl::union_pw_multi_aff pw_multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
19234 {
19235   if (!ptr)
19236     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19237   return isl::union_pw_multi_aff(*this).pullback(upma2);
19238 }
19239 
pw_multi_aff_list()19240 isl::pw_multi_aff_list pw_multi_aff::pw_multi_aff_list() const
19241 {
19242   if (!ptr)
19243     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19244   return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
19245 }
19246 
range_factor_domain()19247 isl::pw_multi_aff pw_multi_aff::range_factor_domain() const
19248 {
19249   if (!ptr)
19250     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19251   auto saved_ctx = ctx();
19252   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19253   auto res = isl_pw_multi_aff_range_factor_domain(copy());
19254   if (!res)
19255     exception::throw_last_error(saved_ctx);
19256   return manage(res);
19257 }
19258 
range_factor_range()19259 isl::pw_multi_aff pw_multi_aff::range_factor_range() const
19260 {
19261   if (!ptr)
19262     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19263   auto saved_ctx = ctx();
19264   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19265   auto res = isl_pw_multi_aff_range_factor_range(copy());
19266   if (!res)
19267     exception::throw_last_error(saved_ctx);
19268   return manage(res);
19269 }
19270 
range_map(isl::space space)19271 isl::pw_multi_aff pw_multi_aff::range_map(isl::space space)
19272 {
19273   if (space.is_null())
19274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19275   auto saved_ctx = space.ctx();
19276   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19277   auto res = isl_pw_multi_aff_range_map(space.release());
19278   if (!res)
19279     exception::throw_last_error(saved_ctx);
19280   return manage(res);
19281 }
19282 
range_product(const isl::multi_pw_aff & multi2)19283 isl::multi_pw_aff pw_multi_aff::range_product(const isl::multi_pw_aff &multi2) const
19284 {
19285   if (!ptr)
19286     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19287   return isl::multi_pw_aff(*this).range_product(multi2);
19288 }
19289 
range_product(const isl::multi_union_pw_aff & multi2)19290 isl::multi_union_pw_aff pw_multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
19291 {
19292   if (!ptr)
19293     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19294   return isl::multi_pw_aff(*this).range_product(multi2);
19295 }
19296 
range_product(isl::pw_multi_aff pma2)19297 isl::pw_multi_aff pw_multi_aff::range_product(isl::pw_multi_aff pma2) const
19298 {
19299   if (!ptr || pma2.is_null())
19300     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19301   auto saved_ctx = ctx();
19302   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19303   auto res = isl_pw_multi_aff_range_product(copy(), pma2.release());
19304   if (!res)
19305     exception::throw_last_error(saved_ctx);
19306   return manage(res);
19307 }
19308 
range_product(const isl::union_pw_multi_aff & upma2)19309 isl::union_pw_multi_aff pw_multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
19310 {
19311   if (!ptr)
19312     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19313   return isl::union_pw_multi_aff(*this).range_product(upma2);
19314 }
19315 
range_product(const isl::multi_aff & pma2)19316 isl::pw_multi_aff pw_multi_aff::range_product(const isl::multi_aff &pma2) const
19317 {
19318   if (!ptr)
19319     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19320   return this->range_product(isl::pw_multi_aff(pma2));
19321 }
19322 
range_product(const isl::pw_aff & pma2)19323 isl::pw_multi_aff pw_multi_aff::range_product(const isl::pw_aff &pma2) const
19324 {
19325   if (!ptr)
19326     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19327   return this->range_product(isl::pw_multi_aff(pma2));
19328 }
19329 
range_tuple_id()19330 isl::id pw_multi_aff::range_tuple_id() const
19331 {
19332   if (!ptr)
19333     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19334   auto saved_ctx = ctx();
19335   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19336   auto res = isl_pw_multi_aff_get_range_tuple_id(get());
19337   if (!res)
19338     exception::throw_last_error(saved_ctx);
19339   return manage(res);
19340 }
19341 
get_range_tuple_id()19342 isl::id pw_multi_aff::get_range_tuple_id() const
19343 {
19344   return range_tuple_id();
19345 }
19346 
reset_range_tuple_id()19347 isl::multi_pw_aff pw_multi_aff::reset_range_tuple_id() const
19348 {
19349   if (!ptr)
19350     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19351   return isl::multi_pw_aff(*this).reset_range_tuple_id();
19352 }
19353 
scale(const isl::multi_val & mv)19354 isl::multi_pw_aff pw_multi_aff::scale(const isl::multi_val &mv) const
19355 {
19356   if (!ptr)
19357     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19358   return isl::multi_pw_aff(*this).scale(mv);
19359 }
19360 
scale(isl::val v)19361 isl::pw_multi_aff pw_multi_aff::scale(isl::val v) const
19362 {
19363   if (!ptr || v.is_null())
19364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19365   auto saved_ctx = ctx();
19366   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19367   auto res = isl_pw_multi_aff_scale_val(copy(), v.release());
19368   if (!res)
19369     exception::throw_last_error(saved_ctx);
19370   return manage(res);
19371 }
19372 
scale(long v)19373 isl::pw_multi_aff pw_multi_aff::scale(long v) const
19374 {
19375   if (!ptr)
19376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19377   return this->scale(isl::val(ctx(), v));
19378 }
19379 
scale_down(const isl::multi_val & mv)19380 isl::multi_pw_aff pw_multi_aff::scale_down(const isl::multi_val &mv) const
19381 {
19382   if (!ptr)
19383     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19384   return isl::multi_pw_aff(*this).scale_down(mv);
19385 }
19386 
scale_down(isl::val v)19387 isl::pw_multi_aff pw_multi_aff::scale_down(isl::val v) const
19388 {
19389   if (!ptr || v.is_null())
19390     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19391   auto saved_ctx = ctx();
19392   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19393   auto res = isl_pw_multi_aff_scale_down_val(copy(), v.release());
19394   if (!res)
19395     exception::throw_last_error(saved_ctx);
19396   return manage(res);
19397 }
19398 
scale_down(long v)19399 isl::pw_multi_aff pw_multi_aff::scale_down(long v) const
19400 {
19401   if (!ptr)
19402     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19403   return this->scale_down(isl::val(ctx(), v));
19404 }
19405 
set_at(int pos,const isl::pw_aff & el)19406 isl::multi_pw_aff pw_multi_aff::set_at(int pos, const isl::pw_aff &el) const
19407 {
19408   if (!ptr)
19409     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19410   return isl::multi_pw_aff(*this).set_at(pos, el);
19411 }
19412 
set_at(int pos,const isl::union_pw_aff & el)19413 isl::multi_union_pw_aff pw_multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
19414 {
19415   if (!ptr)
19416     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19417   return isl::multi_pw_aff(*this).set_at(pos, el);
19418 }
19419 
set_range_tuple(isl::id id)19420 isl::pw_multi_aff pw_multi_aff::set_range_tuple(isl::id id) const
19421 {
19422   if (!ptr || id.is_null())
19423     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19424   auto saved_ctx = ctx();
19425   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19426   auto res = isl_pw_multi_aff_set_range_tuple_id(copy(), id.release());
19427   if (!res)
19428     exception::throw_last_error(saved_ctx);
19429   return manage(res);
19430 }
19431 
set_range_tuple(const std::string & id)19432 isl::pw_multi_aff pw_multi_aff::set_range_tuple(const std::string &id) const
19433 {
19434   if (!ptr)
19435     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19436   return this->set_range_tuple(isl::id(ctx(), id));
19437 }
19438 
size()19439 unsigned pw_multi_aff::size() const
19440 {
19441   if (!ptr)
19442     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19443   return isl::multi_pw_aff(*this).size();
19444 }
19445 
space()19446 isl::space pw_multi_aff::space() const
19447 {
19448   if (!ptr)
19449     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19450   auto saved_ctx = ctx();
19451   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19452   auto res = isl_pw_multi_aff_get_space(get());
19453   if (!res)
19454     exception::throw_last_error(saved_ctx);
19455   return manage(res);
19456 }
19457 
get_space()19458 isl::space pw_multi_aff::get_space() const
19459 {
19460   return space();
19461 }
19462 
sub(const isl::multi_pw_aff & multi2)19463 isl::multi_pw_aff pw_multi_aff::sub(const isl::multi_pw_aff &multi2) const
19464 {
19465   if (!ptr)
19466     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19467   return isl::multi_pw_aff(*this).sub(multi2);
19468 }
19469 
sub(const isl::multi_union_pw_aff & multi2)19470 isl::multi_union_pw_aff pw_multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
19471 {
19472   if (!ptr)
19473     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19474   return isl::multi_pw_aff(*this).sub(multi2);
19475 }
19476 
sub(isl::pw_multi_aff pma2)19477 isl::pw_multi_aff pw_multi_aff::sub(isl::pw_multi_aff pma2) const
19478 {
19479   if (!ptr || pma2.is_null())
19480     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19481   auto saved_ctx = ctx();
19482   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19483   auto res = isl_pw_multi_aff_sub(copy(), pma2.release());
19484   if (!res)
19485     exception::throw_last_error(saved_ctx);
19486   return manage(res);
19487 }
19488 
sub(const isl::union_pw_multi_aff & upma2)19489 isl::union_pw_multi_aff pw_multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
19490 {
19491   if (!ptr)
19492     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19493   return isl::union_pw_multi_aff(*this).sub(upma2);
19494 }
19495 
sub(const isl::multi_aff & pma2)19496 isl::pw_multi_aff pw_multi_aff::sub(const isl::multi_aff &pma2) const
19497 {
19498   if (!ptr)
19499     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19500   return this->sub(isl::pw_multi_aff(pma2));
19501 }
19502 
sub(const isl::pw_aff & pma2)19503 isl::pw_multi_aff pw_multi_aff::sub(const isl::pw_aff &pma2) const
19504 {
19505   if (!ptr)
19506     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19507   return this->sub(isl::pw_multi_aff(pma2));
19508 }
19509 
subtract_domain(isl::set set)19510 isl::pw_multi_aff pw_multi_aff::subtract_domain(isl::set set) const
19511 {
19512   if (!ptr || set.is_null())
19513     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19514   auto saved_ctx = ctx();
19515   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19516   auto res = isl_pw_multi_aff_subtract_domain(copy(), set.release());
19517   if (!res)
19518     exception::throw_last_error(saved_ctx);
19519   return manage(res);
19520 }
19521 
subtract_domain(const isl::space & space)19522 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::space &space) const
19523 {
19524   if (!ptr)
19525     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19526   return isl::union_pw_multi_aff(*this).subtract_domain(space);
19527 }
19528 
subtract_domain(const isl::union_set & uset)19529 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::union_set &uset) const
19530 {
19531   if (!ptr)
19532     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19533   return isl::union_pw_multi_aff(*this).subtract_domain(uset);
19534 }
19535 
subtract_domain(const isl::basic_set & set)19536 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::basic_set &set) const
19537 {
19538   if (!ptr)
19539     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19540   return this->subtract_domain(isl::set(set));
19541 }
19542 
subtract_domain(const isl::point & set)19543 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::point &set) const
19544 {
19545   if (!ptr)
19546     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19547   return this->subtract_domain(isl::set(set));
19548 }
19549 
to_list()19550 isl::pw_multi_aff_list pw_multi_aff::to_list() const
19551 {
19552   if (!ptr)
19553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19554   auto saved_ctx = ctx();
19555   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19556   auto res = isl_pw_multi_aff_to_list(copy());
19557   if (!res)
19558     exception::throw_last_error(saved_ctx);
19559   return manage(res);
19560 }
19561 
to_multi_pw_aff()19562 isl::multi_pw_aff pw_multi_aff::to_multi_pw_aff() const
19563 {
19564   if (!ptr)
19565     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19566   auto saved_ctx = ctx();
19567   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19568   auto res = isl_pw_multi_aff_to_multi_pw_aff(copy());
19569   if (!res)
19570     exception::throw_last_error(saved_ctx);
19571   return manage(res);
19572 }
19573 
to_union_pw_multi_aff()19574 isl::union_pw_multi_aff pw_multi_aff::to_union_pw_multi_aff() const
19575 {
19576   if (!ptr)
19577     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19578   auto saved_ctx = ctx();
19579   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19580   auto res = isl_pw_multi_aff_to_union_pw_multi_aff(copy());
19581   if (!res)
19582     exception::throw_last_error(saved_ctx);
19583   return manage(res);
19584 }
19585 
unbind_params_insert_domain(const isl::multi_id & domain)19586 isl::multi_pw_aff pw_multi_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
19587 {
19588   if (!ptr)
19589     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19590   return isl::multi_pw_aff(*this).unbind_params_insert_domain(domain);
19591 }
19592 
union_add(const isl::multi_pw_aff & mpa2)19593 isl::multi_pw_aff pw_multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
19594 {
19595   if (!ptr)
19596     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19597   return isl::multi_pw_aff(*this).union_add(mpa2);
19598 }
19599 
union_add(const isl::multi_union_pw_aff & mupa2)19600 isl::multi_union_pw_aff pw_multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
19601 {
19602   if (!ptr)
19603     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19604   return isl::multi_pw_aff(*this).union_add(mupa2);
19605 }
19606 
union_add(isl::pw_multi_aff pma2)19607 isl::pw_multi_aff pw_multi_aff::union_add(isl::pw_multi_aff pma2) const
19608 {
19609   if (!ptr || pma2.is_null())
19610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19611   auto saved_ctx = ctx();
19612   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19613   auto res = isl_pw_multi_aff_union_add(copy(), pma2.release());
19614   if (!res)
19615     exception::throw_last_error(saved_ctx);
19616   return manage(res);
19617 }
19618 
union_add(const isl::union_pw_multi_aff & upma2)19619 isl::union_pw_multi_aff pw_multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
19620 {
19621   if (!ptr)
19622     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19623   return isl::union_pw_multi_aff(*this).union_add(upma2);
19624 }
19625 
union_add(const isl::multi_aff & pma2)19626 isl::pw_multi_aff pw_multi_aff::union_add(const isl::multi_aff &pma2) const
19627 {
19628   if (!ptr)
19629     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19630   return this->union_add(isl::pw_multi_aff(pma2));
19631 }
19632 
union_add(const isl::pw_aff & pma2)19633 isl::pw_multi_aff pw_multi_aff::union_add(const isl::pw_aff &pma2) const
19634 {
19635   if (!ptr)
19636     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19637   return this->union_add(isl::pw_multi_aff(pma2));
19638 }
19639 
zero(isl::space space)19640 isl::pw_multi_aff pw_multi_aff::zero(isl::space space)
19641 {
19642   if (space.is_null())
19643     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19644   auto saved_ctx = space.ctx();
19645   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19646   auto res = isl_pw_multi_aff_zero(space.release());
19647   if (!res)
19648     exception::throw_last_error(saved_ctx);
19649   return manage(res);
19650 }
19651 
19652 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff &obj)
19653 {
19654   if (!obj.get())
19655     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19656   auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.get());
19657   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19658   char *str = isl_pw_multi_aff_to_str(obj.get());
19659   if (!str)
19660     exception::throw_last_error(saved_ctx);
19661   os << str;
19662   free(str);
19663   return os;
19664 }
19665 
19666 // implementations for isl::pw_multi_aff_list
manage(__isl_take isl_pw_multi_aff_list * ptr)19667 pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr) {
19668   if (!ptr)
19669     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19670   return pw_multi_aff_list(ptr);
19671 }
manage_copy(__isl_keep isl_pw_multi_aff_list * ptr)19672 pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr) {
19673   if (!ptr)
19674     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19675   auto saved_ctx = isl_pw_multi_aff_list_get_ctx(ptr);
19676   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19677   ptr = isl_pw_multi_aff_list_copy(ptr);
19678   if (!ptr)
19679     exception::throw_last_error(saved_ctx);
19680   return pw_multi_aff_list(ptr);
19681 }
19682 
pw_multi_aff_list()19683 pw_multi_aff_list::pw_multi_aff_list()
19684     : ptr(nullptr) {}
19685 
pw_multi_aff_list(const pw_multi_aff_list & obj)19686 pw_multi_aff_list::pw_multi_aff_list(const pw_multi_aff_list &obj)
19687     : ptr(nullptr)
19688 {
19689   if (!obj.ptr)
19690     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19691   auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.ptr);
19692   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19693   ptr = obj.copy();
19694   if (!ptr)
19695     exception::throw_last_error(saved_ctx);
19696 }
19697 
pw_multi_aff_list(__isl_take isl_pw_multi_aff_list * ptr)19698 pw_multi_aff_list::pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr)
19699     : ptr(ptr) {}
19700 
pw_multi_aff_list(isl::ctx ctx,int n)19701 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, int n)
19702 {
19703   auto saved_ctx = ctx;
19704   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19705   auto res = isl_pw_multi_aff_list_alloc(ctx.release(), n);
19706   if (!res)
19707     exception::throw_last_error(saved_ctx);
19708   ptr = res;
19709 }
19710 
pw_multi_aff_list(isl::pw_multi_aff el)19711 pw_multi_aff_list::pw_multi_aff_list(isl::pw_multi_aff el)
19712 {
19713   if (el.is_null())
19714     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19715   auto saved_ctx = el.ctx();
19716   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19717   auto res = isl_pw_multi_aff_list_from_pw_multi_aff(el.release());
19718   if (!res)
19719     exception::throw_last_error(saved_ctx);
19720   ptr = res;
19721 }
19722 
pw_multi_aff_list(isl::ctx ctx,const std::string & str)19723 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, const std::string &str)
19724 {
19725   auto saved_ctx = ctx;
19726   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19727   auto res = isl_pw_multi_aff_list_read_from_str(ctx.release(), str.c_str());
19728   if (!res)
19729     exception::throw_last_error(saved_ctx);
19730   ptr = res;
19731 }
19732 
19733 pw_multi_aff_list &pw_multi_aff_list::operator=(pw_multi_aff_list obj) {
19734   std::swap(this->ptr, obj.ptr);
19735   return *this;
19736 }
19737 
~pw_multi_aff_list()19738 pw_multi_aff_list::~pw_multi_aff_list() {
19739   if (ptr)
19740     isl_pw_multi_aff_list_free(ptr);
19741 }
19742 
copy()19743 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::copy() const & {
19744   return isl_pw_multi_aff_list_copy(ptr);
19745 }
19746 
get()19747 __isl_keep isl_pw_multi_aff_list *pw_multi_aff_list::get() const {
19748   return ptr;
19749 }
19750 
release()19751 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::release() {
19752   isl_pw_multi_aff_list *tmp = ptr;
19753   ptr = nullptr;
19754   return tmp;
19755 }
19756 
is_null()19757 bool pw_multi_aff_list::is_null() const {
19758   return ptr == nullptr;
19759 }
19760 
ctx()19761 isl::ctx pw_multi_aff_list::ctx() const {
19762   return isl::ctx(isl_pw_multi_aff_list_get_ctx(ptr));
19763 }
19764 
add(isl::pw_multi_aff el)19765 isl::pw_multi_aff_list pw_multi_aff_list::add(isl::pw_multi_aff el) const
19766 {
19767   if (!ptr || el.is_null())
19768     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19769   auto saved_ctx = ctx();
19770   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19771   auto res = isl_pw_multi_aff_list_add(copy(), el.release());
19772   if (!res)
19773     exception::throw_last_error(saved_ctx);
19774   return manage(res);
19775 }
19776 
at(int index)19777 isl::pw_multi_aff pw_multi_aff_list::at(int index) const
19778 {
19779   if (!ptr)
19780     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19781   auto saved_ctx = ctx();
19782   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19783   auto res = isl_pw_multi_aff_list_get_at(get(), index);
19784   if (!res)
19785     exception::throw_last_error(saved_ctx);
19786   return manage(res);
19787 }
19788 
get_at(int index)19789 isl::pw_multi_aff pw_multi_aff_list::get_at(int index) const
19790 {
19791   return at(index);
19792 }
19793 
clear()19794 isl::pw_multi_aff_list pw_multi_aff_list::clear() const
19795 {
19796   if (!ptr)
19797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19798   auto saved_ctx = ctx();
19799   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19800   auto res = isl_pw_multi_aff_list_clear(copy());
19801   if (!res)
19802     exception::throw_last_error(saved_ctx);
19803   return manage(res);
19804 }
19805 
concat(isl::pw_multi_aff_list list2)19806 isl::pw_multi_aff_list pw_multi_aff_list::concat(isl::pw_multi_aff_list list2) const
19807 {
19808   if (!ptr || list2.is_null())
19809     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19810   auto saved_ctx = ctx();
19811   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19812   auto res = isl_pw_multi_aff_list_concat(copy(), list2.release());
19813   if (!res)
19814     exception::throw_last_error(saved_ctx);
19815   return manage(res);
19816 }
19817 
drop(unsigned int first,unsigned int n)19818 isl::pw_multi_aff_list pw_multi_aff_list::drop(unsigned int first, unsigned int n) const
19819 {
19820   if (!ptr)
19821     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19822   auto saved_ctx = ctx();
19823   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19824   auto res = isl_pw_multi_aff_list_drop(copy(), first, n);
19825   if (!res)
19826     exception::throw_last_error(saved_ctx);
19827   return manage(res);
19828 }
19829 
foreach(const std::function<void (isl::pw_multi_aff)> & fn)19830 void pw_multi_aff_list::foreach(const std::function<void(isl::pw_multi_aff)> &fn) const
19831 {
19832   if (!ptr)
19833     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19834   auto saved_ctx = ctx();
19835   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19836   struct fn_data {
19837     std::function<void(isl::pw_multi_aff)> func;
19838     std::exception_ptr eptr;
19839   } fn_data = { fn };
19840   auto fn_lambda = [](isl_pw_multi_aff *arg_0, void *arg_1) -> isl_stat {
19841     auto *data = static_cast<struct fn_data *>(arg_1);
19842     ISL_CPP_TRY {
19843       (data->func)(manage(arg_0));
19844       return isl_stat_ok;
19845     } ISL_CPP_CATCH_ALL {
19846       data->eptr = std::current_exception();
19847       return isl_stat_error;
19848     }
19849   };
19850   auto res = isl_pw_multi_aff_list_foreach(get(), fn_lambda, &fn_data);
19851   if (fn_data.eptr)
19852     std::rethrow_exception(fn_data.eptr);
19853   if (res < 0)
19854     exception::throw_last_error(saved_ctx);
19855   return;
19856 }
19857 
insert(unsigned int pos,isl::pw_multi_aff el)19858 isl::pw_multi_aff_list pw_multi_aff_list::insert(unsigned int pos, isl::pw_multi_aff el) const
19859 {
19860   if (!ptr || el.is_null())
19861     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19862   auto saved_ctx = ctx();
19863   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19864   auto res = isl_pw_multi_aff_list_insert(copy(), pos, el.release());
19865   if (!res)
19866     exception::throw_last_error(saved_ctx);
19867   return manage(res);
19868 }
19869 
size()19870 unsigned pw_multi_aff_list::size() const
19871 {
19872   if (!ptr)
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_multi_aff_list_size(get());
19877   if (res < 0)
19878     exception::throw_last_error(saved_ctx);
19879   return res;
19880 }
19881 
19882 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff_list &obj)
19883 {
19884   if (!obj.get())
19885     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19886   auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.get());
19887   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19888   char *str = isl_pw_multi_aff_list_to_str(obj.get());
19889   if (!str)
19890     exception::throw_last_error(saved_ctx);
19891   os << str;
19892   free(str);
19893   return os;
19894 }
19895 
19896 // implementations for isl::schedule
manage(__isl_take isl_schedule * ptr)19897 schedule manage(__isl_take isl_schedule *ptr) {
19898   if (!ptr)
19899     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19900   return schedule(ptr);
19901 }
manage_copy(__isl_keep isl_schedule * ptr)19902 schedule manage_copy(__isl_keep isl_schedule *ptr) {
19903   if (!ptr)
19904     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19905   auto saved_ctx = isl_schedule_get_ctx(ptr);
19906   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19907   ptr = isl_schedule_copy(ptr);
19908   if (!ptr)
19909     exception::throw_last_error(saved_ctx);
19910   return schedule(ptr);
19911 }
19912 
schedule()19913 schedule::schedule()
19914     : ptr(nullptr) {}
19915 
schedule(const schedule & obj)19916 schedule::schedule(const schedule &obj)
19917     : ptr(nullptr)
19918 {
19919   if (!obj.ptr)
19920     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19921   auto saved_ctx = isl_schedule_get_ctx(obj.ptr);
19922   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19923   ptr = obj.copy();
19924   if (!ptr)
19925     exception::throw_last_error(saved_ctx);
19926 }
19927 
schedule(__isl_take isl_schedule * ptr)19928 schedule::schedule(__isl_take isl_schedule *ptr)
19929     : ptr(ptr) {}
19930 
schedule(isl::ctx ctx,const std::string & str)19931 schedule::schedule(isl::ctx ctx, const std::string &str)
19932 {
19933   auto saved_ctx = ctx;
19934   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19935   auto res = isl_schedule_read_from_str(ctx.release(), str.c_str());
19936   if (!res)
19937     exception::throw_last_error(saved_ctx);
19938   ptr = res;
19939 }
19940 
19941 schedule &schedule::operator=(schedule obj) {
19942   std::swap(this->ptr, obj.ptr);
19943   return *this;
19944 }
19945 
~schedule()19946 schedule::~schedule() {
19947   if (ptr)
19948     isl_schedule_free(ptr);
19949 }
19950 
copy()19951 __isl_give isl_schedule *schedule::copy() const & {
19952   return isl_schedule_copy(ptr);
19953 }
19954 
get()19955 __isl_keep isl_schedule *schedule::get() const {
19956   return ptr;
19957 }
19958 
release()19959 __isl_give isl_schedule *schedule::release() {
19960   isl_schedule *tmp = ptr;
19961   ptr = nullptr;
19962   return tmp;
19963 }
19964 
is_null()19965 bool schedule::is_null() const {
19966   return ptr == nullptr;
19967 }
19968 
ctx()19969 isl::ctx schedule::ctx() const {
19970   return isl::ctx(isl_schedule_get_ctx(ptr));
19971 }
19972 
domain()19973 isl::union_set schedule::domain() const
19974 {
19975   if (!ptr)
19976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19977   auto saved_ctx = ctx();
19978   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19979   auto res = isl_schedule_get_domain(get());
19980   if (!res)
19981     exception::throw_last_error(saved_ctx);
19982   return manage(res);
19983 }
19984 
get_domain()19985 isl::union_set schedule::get_domain() const
19986 {
19987   return domain();
19988 }
19989 
from_domain(isl::union_set domain)19990 isl::schedule schedule::from_domain(isl::union_set domain)
19991 {
19992   if (domain.is_null())
19993     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19994   auto saved_ctx = domain.ctx();
19995   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19996   auto res = isl_schedule_from_domain(domain.release());
19997   if (!res)
19998     exception::throw_last_error(saved_ctx);
19999   return manage(res);
20000 }
20001 
map()20002 isl::union_map schedule::map() const
20003 {
20004   if (!ptr)
20005     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20006   auto saved_ctx = ctx();
20007   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20008   auto res = isl_schedule_get_map(get());
20009   if (!res)
20010     exception::throw_last_error(saved_ctx);
20011   return manage(res);
20012 }
20013 
get_map()20014 isl::union_map schedule::get_map() const
20015 {
20016   return map();
20017 }
20018 
pullback(isl::union_pw_multi_aff upma)20019 isl::schedule schedule::pullback(isl::union_pw_multi_aff upma) const
20020 {
20021   if (!ptr || upma.is_null())
20022     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20023   auto saved_ctx = ctx();
20024   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20025   auto res = isl_schedule_pullback_union_pw_multi_aff(copy(), upma.release());
20026   if (!res)
20027     exception::throw_last_error(saved_ctx);
20028   return manage(res);
20029 }
20030 
root()20031 isl::schedule_node schedule::root() const
20032 {
20033   if (!ptr)
20034     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20035   auto saved_ctx = ctx();
20036   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20037   auto res = isl_schedule_get_root(get());
20038   if (!res)
20039     exception::throw_last_error(saved_ctx);
20040   return manage(res);
20041 }
20042 
get_root()20043 isl::schedule_node schedule::get_root() const
20044 {
20045   return root();
20046 }
20047 
20048 inline std::ostream &operator<<(std::ostream &os, const schedule &obj)
20049 {
20050   if (!obj.get())
20051     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20052   auto saved_ctx = isl_schedule_get_ctx(obj.get());
20053   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20054   char *str = isl_schedule_to_str(obj.get());
20055   if (!str)
20056     exception::throw_last_error(saved_ctx);
20057   os << str;
20058   free(str);
20059   return os;
20060 }
20061 
20062 // implementations for isl::schedule_constraints
manage(__isl_take isl_schedule_constraints * ptr)20063 schedule_constraints manage(__isl_take isl_schedule_constraints *ptr) {
20064   if (!ptr)
20065     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20066   return schedule_constraints(ptr);
20067 }
manage_copy(__isl_keep isl_schedule_constraints * ptr)20068 schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr) {
20069   if (!ptr)
20070     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20071   auto saved_ctx = isl_schedule_constraints_get_ctx(ptr);
20072   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20073   ptr = isl_schedule_constraints_copy(ptr);
20074   if (!ptr)
20075     exception::throw_last_error(saved_ctx);
20076   return schedule_constraints(ptr);
20077 }
20078 
schedule_constraints()20079 schedule_constraints::schedule_constraints()
20080     : ptr(nullptr) {}
20081 
schedule_constraints(const schedule_constraints & obj)20082 schedule_constraints::schedule_constraints(const schedule_constraints &obj)
20083     : ptr(nullptr)
20084 {
20085   if (!obj.ptr)
20086     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20087   auto saved_ctx = isl_schedule_constraints_get_ctx(obj.ptr);
20088   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20089   ptr = obj.copy();
20090   if (!ptr)
20091     exception::throw_last_error(saved_ctx);
20092 }
20093 
schedule_constraints(__isl_take isl_schedule_constraints * ptr)20094 schedule_constraints::schedule_constraints(__isl_take isl_schedule_constraints *ptr)
20095     : ptr(ptr) {}
20096 
schedule_constraints(isl::ctx ctx,const std::string & str)20097 schedule_constraints::schedule_constraints(isl::ctx ctx, const std::string &str)
20098 {
20099   auto saved_ctx = ctx;
20100   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20101   auto res = isl_schedule_constraints_read_from_str(ctx.release(), str.c_str());
20102   if (!res)
20103     exception::throw_last_error(saved_ctx);
20104   ptr = res;
20105 }
20106 
20107 schedule_constraints &schedule_constraints::operator=(schedule_constraints obj) {
20108   std::swap(this->ptr, obj.ptr);
20109   return *this;
20110 }
20111 
~schedule_constraints()20112 schedule_constraints::~schedule_constraints() {
20113   if (ptr)
20114     isl_schedule_constraints_free(ptr);
20115 }
20116 
copy()20117 __isl_give isl_schedule_constraints *schedule_constraints::copy() const & {
20118   return isl_schedule_constraints_copy(ptr);
20119 }
20120 
get()20121 __isl_keep isl_schedule_constraints *schedule_constraints::get() const {
20122   return ptr;
20123 }
20124 
release()20125 __isl_give isl_schedule_constraints *schedule_constraints::release() {
20126   isl_schedule_constraints *tmp = ptr;
20127   ptr = nullptr;
20128   return tmp;
20129 }
20130 
is_null()20131 bool schedule_constraints::is_null() const {
20132   return ptr == nullptr;
20133 }
20134 
ctx()20135 isl::ctx schedule_constraints::ctx() const {
20136   return isl::ctx(isl_schedule_constraints_get_ctx(ptr));
20137 }
20138 
coincidence()20139 isl::union_map schedule_constraints::coincidence() const
20140 {
20141   if (!ptr)
20142     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20143   auto saved_ctx = ctx();
20144   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20145   auto res = isl_schedule_constraints_get_coincidence(get());
20146   if (!res)
20147     exception::throw_last_error(saved_ctx);
20148   return manage(res);
20149 }
20150 
get_coincidence()20151 isl::union_map schedule_constraints::get_coincidence() const
20152 {
20153   return coincidence();
20154 }
20155 
compute_schedule()20156 isl::schedule schedule_constraints::compute_schedule() const
20157 {
20158   if (!ptr)
20159     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20160   auto saved_ctx = ctx();
20161   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20162   auto res = isl_schedule_constraints_compute_schedule(copy());
20163   if (!res)
20164     exception::throw_last_error(saved_ctx);
20165   return manage(res);
20166 }
20167 
conditional_validity()20168 isl::union_map schedule_constraints::conditional_validity() const
20169 {
20170   if (!ptr)
20171     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20172   auto saved_ctx = ctx();
20173   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20174   auto res = isl_schedule_constraints_get_conditional_validity(get());
20175   if (!res)
20176     exception::throw_last_error(saved_ctx);
20177   return manage(res);
20178 }
20179 
get_conditional_validity()20180 isl::union_map schedule_constraints::get_conditional_validity() const
20181 {
20182   return conditional_validity();
20183 }
20184 
conditional_validity_condition()20185 isl::union_map schedule_constraints::conditional_validity_condition() const
20186 {
20187   if (!ptr)
20188     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20189   auto saved_ctx = ctx();
20190   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20191   auto res = isl_schedule_constraints_get_conditional_validity_condition(get());
20192   if (!res)
20193     exception::throw_last_error(saved_ctx);
20194   return manage(res);
20195 }
20196 
get_conditional_validity_condition()20197 isl::union_map schedule_constraints::get_conditional_validity_condition() const
20198 {
20199   return conditional_validity_condition();
20200 }
20201 
context()20202 isl::set schedule_constraints::context() const
20203 {
20204   if (!ptr)
20205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20206   auto saved_ctx = ctx();
20207   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20208   auto res = isl_schedule_constraints_get_context(get());
20209   if (!res)
20210     exception::throw_last_error(saved_ctx);
20211   return manage(res);
20212 }
20213 
get_context()20214 isl::set schedule_constraints::get_context() const
20215 {
20216   return context();
20217 }
20218 
domain()20219 isl::union_set schedule_constraints::domain() const
20220 {
20221   if (!ptr)
20222     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20223   auto saved_ctx = ctx();
20224   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20225   auto res = isl_schedule_constraints_get_domain(get());
20226   if (!res)
20227     exception::throw_last_error(saved_ctx);
20228   return manage(res);
20229 }
20230 
get_domain()20231 isl::union_set schedule_constraints::get_domain() const
20232 {
20233   return domain();
20234 }
20235 
on_domain(isl::union_set domain)20236 isl::schedule_constraints schedule_constraints::on_domain(isl::union_set domain)
20237 {
20238   if (domain.is_null())
20239     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20240   auto saved_ctx = domain.ctx();
20241   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20242   auto res = isl_schedule_constraints_on_domain(domain.release());
20243   if (!res)
20244     exception::throw_last_error(saved_ctx);
20245   return manage(res);
20246 }
20247 
proximity()20248 isl::union_map schedule_constraints::proximity() const
20249 {
20250   if (!ptr)
20251     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20252   auto saved_ctx = ctx();
20253   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20254   auto res = isl_schedule_constraints_get_proximity(get());
20255   if (!res)
20256     exception::throw_last_error(saved_ctx);
20257   return manage(res);
20258 }
20259 
get_proximity()20260 isl::union_map schedule_constraints::get_proximity() const
20261 {
20262   return proximity();
20263 }
20264 
set_coincidence(isl::union_map coincidence)20265 isl::schedule_constraints schedule_constraints::set_coincidence(isl::union_map coincidence) const
20266 {
20267   if (!ptr || coincidence.is_null())
20268     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20269   auto saved_ctx = ctx();
20270   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20271   auto res = isl_schedule_constraints_set_coincidence(copy(), coincidence.release());
20272   if (!res)
20273     exception::throw_last_error(saved_ctx);
20274   return manage(res);
20275 }
20276 
set_conditional_validity(isl::union_map condition,isl::union_map validity)20277 isl::schedule_constraints schedule_constraints::set_conditional_validity(isl::union_map condition, isl::union_map validity) const
20278 {
20279   if (!ptr || condition.is_null() || validity.is_null())
20280     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20281   auto saved_ctx = ctx();
20282   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20283   auto res = isl_schedule_constraints_set_conditional_validity(copy(), condition.release(), validity.release());
20284   if (!res)
20285     exception::throw_last_error(saved_ctx);
20286   return manage(res);
20287 }
20288 
set_context(isl::set context)20289 isl::schedule_constraints schedule_constraints::set_context(isl::set context) const
20290 {
20291   if (!ptr || context.is_null())
20292     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20293   auto saved_ctx = ctx();
20294   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20295   auto res = isl_schedule_constraints_set_context(copy(), context.release());
20296   if (!res)
20297     exception::throw_last_error(saved_ctx);
20298   return manage(res);
20299 }
20300 
set_proximity(isl::union_map proximity)20301 isl::schedule_constraints schedule_constraints::set_proximity(isl::union_map proximity) const
20302 {
20303   if (!ptr || proximity.is_null())
20304     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20305   auto saved_ctx = ctx();
20306   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20307   auto res = isl_schedule_constraints_set_proximity(copy(), proximity.release());
20308   if (!res)
20309     exception::throw_last_error(saved_ctx);
20310   return manage(res);
20311 }
20312 
set_validity(isl::union_map validity)20313 isl::schedule_constraints schedule_constraints::set_validity(isl::union_map validity) const
20314 {
20315   if (!ptr || validity.is_null())
20316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20317   auto saved_ctx = ctx();
20318   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20319   auto res = isl_schedule_constraints_set_validity(copy(), validity.release());
20320   if (!res)
20321     exception::throw_last_error(saved_ctx);
20322   return manage(res);
20323 }
20324 
validity()20325 isl::union_map schedule_constraints::validity() 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   auto res = isl_schedule_constraints_get_validity(get());
20332   if (!res)
20333     exception::throw_last_error(saved_ctx);
20334   return manage(res);
20335 }
20336 
get_validity()20337 isl::union_map schedule_constraints::get_validity() const
20338 {
20339   return validity();
20340 }
20341 
20342 inline std::ostream &operator<<(std::ostream &os, const schedule_constraints &obj)
20343 {
20344   if (!obj.get())
20345     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20346   auto saved_ctx = isl_schedule_constraints_get_ctx(obj.get());
20347   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20348   char *str = isl_schedule_constraints_to_str(obj.get());
20349   if (!str)
20350     exception::throw_last_error(saved_ctx);
20351   os << str;
20352   free(str);
20353   return os;
20354 }
20355 
20356 // implementations for isl::schedule_node
manage(__isl_take isl_schedule_node * ptr)20357 schedule_node manage(__isl_take isl_schedule_node *ptr) {
20358   if (!ptr)
20359     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20360   return schedule_node(ptr);
20361 }
manage_copy(__isl_keep isl_schedule_node * ptr)20362 schedule_node manage_copy(__isl_keep isl_schedule_node *ptr) {
20363   if (!ptr)
20364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20365   auto saved_ctx = isl_schedule_node_get_ctx(ptr);
20366   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20367   ptr = isl_schedule_node_copy(ptr);
20368   if (!ptr)
20369     exception::throw_last_error(saved_ctx);
20370   return schedule_node(ptr);
20371 }
20372 
schedule_node()20373 schedule_node::schedule_node()
20374     : ptr(nullptr) {}
20375 
schedule_node(const schedule_node & obj)20376 schedule_node::schedule_node(const schedule_node &obj)
20377     : ptr(nullptr)
20378 {
20379   if (!obj.ptr)
20380     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20381   auto saved_ctx = isl_schedule_node_get_ctx(obj.ptr);
20382   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20383   ptr = obj.copy();
20384   if (!ptr)
20385     exception::throw_last_error(saved_ctx);
20386 }
20387 
schedule_node(__isl_take isl_schedule_node * ptr)20388 schedule_node::schedule_node(__isl_take isl_schedule_node *ptr)
20389     : ptr(ptr) {}
20390 
20391 schedule_node &schedule_node::operator=(schedule_node obj) {
20392   std::swap(this->ptr, obj.ptr);
20393   return *this;
20394 }
20395 
~schedule_node()20396 schedule_node::~schedule_node() {
20397   if (ptr)
20398     isl_schedule_node_free(ptr);
20399 }
20400 
copy()20401 __isl_give isl_schedule_node *schedule_node::copy() const & {
20402   return isl_schedule_node_copy(ptr);
20403 }
20404 
get()20405 __isl_keep isl_schedule_node *schedule_node::get() const {
20406   return ptr;
20407 }
20408 
release()20409 __isl_give isl_schedule_node *schedule_node::release() {
20410   isl_schedule_node *tmp = ptr;
20411   ptr = nullptr;
20412   return tmp;
20413 }
20414 
is_null()20415 bool schedule_node::is_null() const {
20416   return ptr == nullptr;
20417 }
20418 
20419 template <typename T, typename>
isa_type(T subtype)20420 bool schedule_node::isa_type(T subtype) const
20421 {
20422   if (is_null())
20423     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20424   return isl_schedule_node_get_type(get()) == subtype;
20425 }
20426 template <class T>
isa()20427 bool schedule_node::isa() const
20428 {
20429   return isa_type<decltype(T::type)>(T::type);
20430 }
20431 template <class T>
as()20432 T schedule_node::as() const
20433 {
20434  if (!isa<T>())
20435     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
20436   return T(copy());
20437 }
20438 
ctx()20439 isl::ctx schedule_node::ctx() const {
20440   return isl::ctx(isl_schedule_node_get_ctx(ptr));
20441 }
20442 
ancestor(int generation)20443 isl::schedule_node schedule_node::ancestor(int generation) const
20444 {
20445   if (!ptr)
20446     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20447   auto saved_ctx = ctx();
20448   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20449   auto res = isl_schedule_node_ancestor(copy(), generation);
20450   if (!res)
20451     exception::throw_last_error(saved_ctx);
20452   return manage(res);
20453 }
20454 
ancestor_child_position(const isl::schedule_node & ancestor)20455 unsigned schedule_node::ancestor_child_position(const isl::schedule_node &ancestor) const
20456 {
20457   if (!ptr || ancestor.is_null())
20458     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20459   auto saved_ctx = ctx();
20460   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20461   auto res = isl_schedule_node_get_ancestor_child_position(get(), ancestor.get());
20462   if (res < 0)
20463     exception::throw_last_error(saved_ctx);
20464   return res;
20465 }
20466 
get_ancestor_child_position(const isl::schedule_node & ancestor)20467 unsigned schedule_node::get_ancestor_child_position(const isl::schedule_node &ancestor) const
20468 {
20469   return ancestor_child_position(ancestor);
20470 }
20471 
child(int pos)20472 isl::schedule_node schedule_node::child(int pos) const
20473 {
20474   if (!ptr)
20475     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20476   auto saved_ctx = ctx();
20477   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20478   auto res = isl_schedule_node_child(copy(), pos);
20479   if (!res)
20480     exception::throw_last_error(saved_ctx);
20481   return manage(res);
20482 }
20483 
child_position()20484 unsigned schedule_node::child_position() const
20485 {
20486   if (!ptr)
20487     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20488   auto saved_ctx = ctx();
20489   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20490   auto res = isl_schedule_node_get_child_position(get());
20491   if (res < 0)
20492     exception::throw_last_error(saved_ctx);
20493   return res;
20494 }
20495 
get_child_position()20496 unsigned schedule_node::get_child_position() const
20497 {
20498   return child_position();
20499 }
20500 
every_descendant(const std::function<bool (isl::schedule_node)> & test)20501 bool schedule_node::every_descendant(const std::function<bool(isl::schedule_node)> &test) const
20502 {
20503   if (!ptr)
20504     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20505   auto saved_ctx = ctx();
20506   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20507   struct test_data {
20508     std::function<bool(isl::schedule_node)> func;
20509     std::exception_ptr eptr;
20510   } test_data = { test };
20511   auto test_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
20512     auto *data = static_cast<struct test_data *>(arg_1);
20513     ISL_CPP_TRY {
20514       auto ret = (data->func)(manage_copy(arg_0));
20515       return ret ? isl_bool_true : isl_bool_false;
20516     } ISL_CPP_CATCH_ALL {
20517       data->eptr = std::current_exception();
20518       return isl_bool_error;
20519     }
20520   };
20521   auto res = isl_schedule_node_every_descendant(get(), test_lambda, &test_data);
20522   if (test_data.eptr)
20523     std::rethrow_exception(test_data.eptr);
20524   if (res < 0)
20525     exception::throw_last_error(saved_ctx);
20526   return res;
20527 }
20528 
first_child()20529 isl::schedule_node schedule_node::first_child() const
20530 {
20531   if (!ptr)
20532     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20533   auto saved_ctx = ctx();
20534   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20535   auto res = isl_schedule_node_first_child(copy());
20536   if (!res)
20537     exception::throw_last_error(saved_ctx);
20538   return manage(res);
20539 }
20540 
foreach_ancestor_top_down(const std::function<void (isl::schedule_node)> & fn)20541 void schedule_node::foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const
20542 {
20543   if (!ptr)
20544     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20545   auto saved_ctx = ctx();
20546   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20547   struct fn_data {
20548     std::function<void(isl::schedule_node)> func;
20549     std::exception_ptr eptr;
20550   } fn_data = { fn };
20551   auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_stat {
20552     auto *data = static_cast<struct fn_data *>(arg_1);
20553     ISL_CPP_TRY {
20554       (data->func)(manage_copy(arg_0));
20555       return isl_stat_ok;
20556     } ISL_CPP_CATCH_ALL {
20557       data->eptr = std::current_exception();
20558       return isl_stat_error;
20559     }
20560   };
20561   auto res = isl_schedule_node_foreach_ancestor_top_down(get(), fn_lambda, &fn_data);
20562   if (fn_data.eptr)
20563     std::rethrow_exception(fn_data.eptr);
20564   if (res < 0)
20565     exception::throw_last_error(saved_ctx);
20566   return;
20567 }
20568 
foreach_descendant_top_down(const std::function<bool (isl::schedule_node)> & fn)20569 void schedule_node::foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const
20570 {
20571   if (!ptr)
20572     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20573   auto saved_ctx = ctx();
20574   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20575   struct fn_data {
20576     std::function<bool(isl::schedule_node)> func;
20577     std::exception_ptr eptr;
20578   } fn_data = { fn };
20579   auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
20580     auto *data = static_cast<struct fn_data *>(arg_1);
20581     ISL_CPP_TRY {
20582       auto ret = (data->func)(manage_copy(arg_0));
20583       return ret ? isl_bool_true : isl_bool_false;
20584     } ISL_CPP_CATCH_ALL {
20585       data->eptr = std::current_exception();
20586       return isl_bool_error;
20587     }
20588   };
20589   auto res = isl_schedule_node_foreach_descendant_top_down(get(), fn_lambda, &fn_data);
20590   if (fn_data.eptr)
20591     std::rethrow_exception(fn_data.eptr);
20592   if (res < 0)
20593     exception::throw_last_error(saved_ctx);
20594   return;
20595 }
20596 
from_domain(isl::union_set domain)20597 isl::schedule_node schedule_node::from_domain(isl::union_set domain)
20598 {
20599   if (domain.is_null())
20600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20601   auto saved_ctx = domain.ctx();
20602   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20603   auto res = isl_schedule_node_from_domain(domain.release());
20604   if (!res)
20605     exception::throw_last_error(saved_ctx);
20606   return manage(res);
20607 }
20608 
from_extension(isl::union_map extension)20609 isl::schedule_node schedule_node::from_extension(isl::union_map extension)
20610 {
20611   if (extension.is_null())
20612     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20613   auto saved_ctx = extension.ctx();
20614   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20615   auto res = isl_schedule_node_from_extension(extension.release());
20616   if (!res)
20617     exception::throw_last_error(saved_ctx);
20618   return manage(res);
20619 }
20620 
graft_after(isl::schedule_node graft)20621 isl::schedule_node schedule_node::graft_after(isl::schedule_node graft) const
20622 {
20623   if (!ptr || graft.is_null())
20624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20625   auto saved_ctx = ctx();
20626   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20627   auto res = isl_schedule_node_graft_after(copy(), graft.release());
20628   if (!res)
20629     exception::throw_last_error(saved_ctx);
20630   return manage(res);
20631 }
20632 
graft_before(isl::schedule_node graft)20633 isl::schedule_node schedule_node::graft_before(isl::schedule_node graft) const
20634 {
20635   if (!ptr || graft.is_null())
20636     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20637   auto saved_ctx = ctx();
20638   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20639   auto res = isl_schedule_node_graft_before(copy(), graft.release());
20640   if (!res)
20641     exception::throw_last_error(saved_ctx);
20642   return manage(res);
20643 }
20644 
has_children()20645 bool schedule_node::has_children() const
20646 {
20647   if (!ptr)
20648     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20649   auto saved_ctx = ctx();
20650   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20651   auto res = isl_schedule_node_has_children(get());
20652   if (res < 0)
20653     exception::throw_last_error(saved_ctx);
20654   return res;
20655 }
20656 
has_next_sibling()20657 bool schedule_node::has_next_sibling() const
20658 {
20659   if (!ptr)
20660     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20661   auto saved_ctx = ctx();
20662   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20663   auto res = isl_schedule_node_has_next_sibling(get());
20664   if (res < 0)
20665     exception::throw_last_error(saved_ctx);
20666   return res;
20667 }
20668 
has_parent()20669 bool schedule_node::has_parent() const
20670 {
20671   if (!ptr)
20672     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20673   auto saved_ctx = ctx();
20674   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20675   auto res = isl_schedule_node_has_parent(get());
20676   if (res < 0)
20677     exception::throw_last_error(saved_ctx);
20678   return res;
20679 }
20680 
has_previous_sibling()20681 bool schedule_node::has_previous_sibling() const
20682 {
20683   if (!ptr)
20684     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20685   auto saved_ctx = ctx();
20686   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20687   auto res = isl_schedule_node_has_previous_sibling(get());
20688   if (res < 0)
20689     exception::throw_last_error(saved_ctx);
20690   return res;
20691 }
20692 
insert_context(isl::set context)20693 isl::schedule_node schedule_node::insert_context(isl::set context) const
20694 {
20695   if (!ptr || context.is_null())
20696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20697   auto saved_ctx = ctx();
20698   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20699   auto res = isl_schedule_node_insert_context(copy(), context.release());
20700   if (!res)
20701     exception::throw_last_error(saved_ctx);
20702   return manage(res);
20703 }
20704 
insert_filter(isl::union_set filter)20705 isl::schedule_node schedule_node::insert_filter(isl::union_set filter) const
20706 {
20707   if (!ptr || filter.is_null())
20708     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20709   auto saved_ctx = ctx();
20710   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20711   auto res = isl_schedule_node_insert_filter(copy(), filter.release());
20712   if (!res)
20713     exception::throw_last_error(saved_ctx);
20714   return manage(res);
20715 }
20716 
insert_guard(isl::set context)20717 isl::schedule_node schedule_node::insert_guard(isl::set context) const
20718 {
20719   if (!ptr || context.is_null())
20720     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20721   auto saved_ctx = ctx();
20722   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20723   auto res = isl_schedule_node_insert_guard(copy(), context.release());
20724   if (!res)
20725     exception::throw_last_error(saved_ctx);
20726   return manage(res);
20727 }
20728 
insert_mark(isl::id mark)20729 isl::schedule_node schedule_node::insert_mark(isl::id mark) const
20730 {
20731   if (!ptr || mark.is_null())
20732     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20733   auto saved_ctx = ctx();
20734   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20735   auto res = isl_schedule_node_insert_mark(copy(), mark.release());
20736   if (!res)
20737     exception::throw_last_error(saved_ctx);
20738   return manage(res);
20739 }
20740 
insert_mark(const std::string & mark)20741 isl::schedule_node schedule_node::insert_mark(const std::string &mark) const
20742 {
20743   if (!ptr)
20744     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20745   return this->insert_mark(isl::id(ctx(), mark));
20746 }
20747 
insert_partial_schedule(isl::multi_union_pw_aff schedule)20748 isl::schedule_node schedule_node::insert_partial_schedule(isl::multi_union_pw_aff schedule) const
20749 {
20750   if (!ptr || schedule.is_null())
20751     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20752   auto saved_ctx = ctx();
20753   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20754   auto res = isl_schedule_node_insert_partial_schedule(copy(), schedule.release());
20755   if (!res)
20756     exception::throw_last_error(saved_ctx);
20757   return manage(res);
20758 }
20759 
insert_sequence(isl::union_set_list filters)20760 isl::schedule_node schedule_node::insert_sequence(isl::union_set_list filters) const
20761 {
20762   if (!ptr || filters.is_null())
20763     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20764   auto saved_ctx = ctx();
20765   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20766   auto res = isl_schedule_node_insert_sequence(copy(), filters.release());
20767   if (!res)
20768     exception::throw_last_error(saved_ctx);
20769   return manage(res);
20770 }
20771 
insert_set(isl::union_set_list filters)20772 isl::schedule_node schedule_node::insert_set(isl::union_set_list filters) const
20773 {
20774   if (!ptr || filters.is_null())
20775     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20776   auto saved_ctx = ctx();
20777   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20778   auto res = isl_schedule_node_insert_set(copy(), filters.release());
20779   if (!res)
20780     exception::throw_last_error(saved_ctx);
20781   return manage(res);
20782 }
20783 
is_equal(const isl::schedule_node & node2)20784 bool schedule_node::is_equal(const isl::schedule_node &node2) const
20785 {
20786   if (!ptr || node2.is_null())
20787     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20788   auto saved_ctx = ctx();
20789   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20790   auto res = isl_schedule_node_is_equal(get(), node2.get());
20791   if (res < 0)
20792     exception::throw_last_error(saved_ctx);
20793   return res;
20794 }
20795 
is_subtree_anchored()20796 bool schedule_node::is_subtree_anchored() const
20797 {
20798   if (!ptr)
20799     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20800   auto saved_ctx = ctx();
20801   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20802   auto res = isl_schedule_node_is_subtree_anchored(get());
20803   if (res < 0)
20804     exception::throw_last_error(saved_ctx);
20805   return res;
20806 }
20807 
map_descendant_bottom_up(const std::function<isl::schedule_node (isl::schedule_node)> & fn)20808 isl::schedule_node schedule_node::map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const
20809 {
20810   if (!ptr)
20811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20812   auto saved_ctx = ctx();
20813   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20814   struct fn_data {
20815     std::function<isl::schedule_node(isl::schedule_node)> func;
20816     std::exception_ptr eptr;
20817   } fn_data = { fn };
20818   auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_schedule_node * {
20819     auto *data = static_cast<struct fn_data *>(arg_1);
20820     ISL_CPP_TRY {
20821       auto ret = (data->func)(manage(arg_0));
20822       return ret.release();
20823     } ISL_CPP_CATCH_ALL {
20824       data->eptr = std::current_exception();
20825       return NULL;
20826     }
20827   };
20828   auto res = isl_schedule_node_map_descendant_bottom_up(copy(), fn_lambda, &fn_data);
20829   if (fn_data.eptr)
20830     std::rethrow_exception(fn_data.eptr);
20831   if (!res)
20832     exception::throw_last_error(saved_ctx);
20833   return manage(res);
20834 }
20835 
n_children()20836 unsigned schedule_node::n_children() const
20837 {
20838   if (!ptr)
20839     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20840   auto saved_ctx = ctx();
20841   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20842   auto res = isl_schedule_node_n_children(get());
20843   if (res < 0)
20844     exception::throw_last_error(saved_ctx);
20845   return res;
20846 }
20847 
next_sibling()20848 isl::schedule_node schedule_node::next_sibling() const
20849 {
20850   if (!ptr)
20851     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20852   auto saved_ctx = ctx();
20853   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20854   auto res = isl_schedule_node_next_sibling(copy());
20855   if (!res)
20856     exception::throw_last_error(saved_ctx);
20857   return manage(res);
20858 }
20859 
order_after(isl::union_set filter)20860 isl::schedule_node schedule_node::order_after(isl::union_set filter) const
20861 {
20862   if (!ptr || filter.is_null())
20863     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20864   auto saved_ctx = ctx();
20865   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20866   auto res = isl_schedule_node_order_after(copy(), filter.release());
20867   if (!res)
20868     exception::throw_last_error(saved_ctx);
20869   return manage(res);
20870 }
20871 
order_before(isl::union_set filter)20872 isl::schedule_node schedule_node::order_before(isl::union_set filter) const
20873 {
20874   if (!ptr || filter.is_null())
20875     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20876   auto saved_ctx = ctx();
20877   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20878   auto res = isl_schedule_node_order_before(copy(), filter.release());
20879   if (!res)
20880     exception::throw_last_error(saved_ctx);
20881   return manage(res);
20882 }
20883 
parent()20884 isl::schedule_node schedule_node::parent() const
20885 {
20886   if (!ptr)
20887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20888   auto saved_ctx = ctx();
20889   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20890   auto res = isl_schedule_node_parent(copy());
20891   if (!res)
20892     exception::throw_last_error(saved_ctx);
20893   return manage(res);
20894 }
20895 
prefix_schedule_multi_union_pw_aff()20896 isl::multi_union_pw_aff schedule_node::prefix_schedule_multi_union_pw_aff() const
20897 {
20898   if (!ptr)
20899     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20900   auto saved_ctx = ctx();
20901   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20902   auto res = isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(get());
20903   if (!res)
20904     exception::throw_last_error(saved_ctx);
20905   return manage(res);
20906 }
20907 
get_prefix_schedule_multi_union_pw_aff()20908 isl::multi_union_pw_aff schedule_node::get_prefix_schedule_multi_union_pw_aff() const
20909 {
20910   return prefix_schedule_multi_union_pw_aff();
20911 }
20912 
prefix_schedule_union_map()20913 isl::union_map schedule_node::prefix_schedule_union_map() const
20914 {
20915   if (!ptr)
20916     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20917   auto saved_ctx = ctx();
20918   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20919   auto res = isl_schedule_node_get_prefix_schedule_union_map(get());
20920   if (!res)
20921     exception::throw_last_error(saved_ctx);
20922   return manage(res);
20923 }
20924 
get_prefix_schedule_union_map()20925 isl::union_map schedule_node::get_prefix_schedule_union_map() const
20926 {
20927   return prefix_schedule_union_map();
20928 }
20929 
prefix_schedule_union_pw_multi_aff()20930 isl::union_pw_multi_aff schedule_node::prefix_schedule_union_pw_multi_aff() const
20931 {
20932   if (!ptr)
20933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20934   auto saved_ctx = ctx();
20935   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20936   auto res = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(get());
20937   if (!res)
20938     exception::throw_last_error(saved_ctx);
20939   return manage(res);
20940 }
20941 
get_prefix_schedule_union_pw_multi_aff()20942 isl::union_pw_multi_aff schedule_node::get_prefix_schedule_union_pw_multi_aff() const
20943 {
20944   return prefix_schedule_union_pw_multi_aff();
20945 }
20946 
previous_sibling()20947 isl::schedule_node schedule_node::previous_sibling() const
20948 {
20949   if (!ptr)
20950     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20951   auto saved_ctx = ctx();
20952   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20953   auto res = isl_schedule_node_previous_sibling(copy());
20954   if (!res)
20955     exception::throw_last_error(saved_ctx);
20956   return manage(res);
20957 }
20958 
root()20959 isl::schedule_node schedule_node::root() const
20960 {
20961   if (!ptr)
20962     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20963   auto saved_ctx = ctx();
20964   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20965   auto res = isl_schedule_node_root(copy());
20966   if (!res)
20967     exception::throw_last_error(saved_ctx);
20968   return manage(res);
20969 }
20970 
schedule()20971 isl::schedule schedule_node::schedule() const
20972 {
20973   if (!ptr)
20974     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20975   auto saved_ctx = ctx();
20976   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20977   auto res = isl_schedule_node_get_schedule(get());
20978   if (!res)
20979     exception::throw_last_error(saved_ctx);
20980   return manage(res);
20981 }
20982 
get_schedule()20983 isl::schedule schedule_node::get_schedule() const
20984 {
20985   return schedule();
20986 }
20987 
shared_ancestor(const isl::schedule_node & node2)20988 isl::schedule_node schedule_node::shared_ancestor(const isl::schedule_node &node2) const
20989 {
20990   if (!ptr || node2.is_null())
20991     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20992   auto saved_ctx = ctx();
20993   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20994   auto res = isl_schedule_node_get_shared_ancestor(get(), node2.get());
20995   if (!res)
20996     exception::throw_last_error(saved_ctx);
20997   return manage(res);
20998 }
20999 
get_shared_ancestor(const isl::schedule_node & node2)21000 isl::schedule_node schedule_node::get_shared_ancestor(const isl::schedule_node &node2) const
21001 {
21002   return shared_ancestor(node2);
21003 }
21004 
tree_depth()21005 unsigned schedule_node::tree_depth() const
21006 {
21007   if (!ptr)
21008     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21009   auto saved_ctx = ctx();
21010   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21011   auto res = isl_schedule_node_get_tree_depth(get());
21012   if (res < 0)
21013     exception::throw_last_error(saved_ctx);
21014   return res;
21015 }
21016 
get_tree_depth()21017 unsigned schedule_node::get_tree_depth() const
21018 {
21019   return tree_depth();
21020 }
21021 
21022 inline std::ostream &operator<<(std::ostream &os, const schedule_node &obj)
21023 {
21024   if (!obj.get())
21025     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21026   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21027   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21028   char *str = isl_schedule_node_to_str(obj.get());
21029   if (!str)
21030     exception::throw_last_error(saved_ctx);
21031   os << str;
21032   free(str);
21033   return os;
21034 }
21035 
21036 // implementations for isl::schedule_node_band
schedule_node_band()21037 schedule_node_band::schedule_node_band()
21038     : schedule_node() {}
21039 
schedule_node_band(const schedule_node_band & obj)21040 schedule_node_band::schedule_node_band(const schedule_node_band &obj)
21041     : schedule_node(obj)
21042 {
21043 }
21044 
schedule_node_band(__isl_take isl_schedule_node * ptr)21045 schedule_node_band::schedule_node_band(__isl_take isl_schedule_node *ptr)
21046     : schedule_node(ptr) {}
21047 
21048 schedule_node_band &schedule_node_band::operator=(schedule_node_band obj) {
21049   std::swap(this->ptr, obj.ptr);
21050   return *this;
21051 }
21052 
ctx()21053 isl::ctx schedule_node_band::ctx() const {
21054   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21055 }
21056 
ast_build_options()21057 isl::union_set schedule_node_band::ast_build_options() const
21058 {
21059   if (!ptr)
21060     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21061   auto saved_ctx = ctx();
21062   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21063   auto res = isl_schedule_node_band_get_ast_build_options(get());
21064   if (!res)
21065     exception::throw_last_error(saved_ctx);
21066   return manage(res);
21067 }
21068 
get_ast_build_options()21069 isl::union_set schedule_node_band::get_ast_build_options() const
21070 {
21071   return ast_build_options();
21072 }
21073 
ast_isolate_option()21074 isl::set schedule_node_band::ast_isolate_option() const
21075 {
21076   if (!ptr)
21077     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21078   auto saved_ctx = ctx();
21079   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21080   auto res = isl_schedule_node_band_get_ast_isolate_option(get());
21081   if (!res)
21082     exception::throw_last_error(saved_ctx);
21083   return manage(res);
21084 }
21085 
get_ast_isolate_option()21086 isl::set schedule_node_band::get_ast_isolate_option() const
21087 {
21088   return ast_isolate_option();
21089 }
21090 
member_get_coincident(int pos)21091 bool schedule_node_band::member_get_coincident(int pos) const
21092 {
21093   if (!ptr)
21094     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21095   auto saved_ctx = ctx();
21096   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21097   auto res = isl_schedule_node_band_member_get_coincident(get(), pos);
21098   if (res < 0)
21099     exception::throw_last_error(saved_ctx);
21100   return res;
21101 }
21102 
member_set_coincident(int pos,int coincident)21103 schedule_node_band schedule_node_band::member_set_coincident(int pos, int coincident) const
21104 {
21105   if (!ptr)
21106     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21107   auto saved_ctx = ctx();
21108   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21109   auto res = isl_schedule_node_band_member_set_coincident(copy(), pos, coincident);
21110   if (!res)
21111     exception::throw_last_error(saved_ctx);
21112   return manage(res).as<schedule_node_band>();
21113 }
21114 
mod(isl::multi_val mv)21115 schedule_node_band schedule_node_band::mod(isl::multi_val mv) const
21116 {
21117   if (!ptr || mv.is_null())
21118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21119   auto saved_ctx = ctx();
21120   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21121   auto res = isl_schedule_node_band_mod(copy(), mv.release());
21122   if (!res)
21123     exception::throw_last_error(saved_ctx);
21124   return manage(res).as<schedule_node_band>();
21125 }
21126 
n_member()21127 unsigned schedule_node_band::n_member() const
21128 {
21129   if (!ptr)
21130     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21131   auto saved_ctx = ctx();
21132   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21133   auto res = isl_schedule_node_band_n_member(get());
21134   if (res < 0)
21135     exception::throw_last_error(saved_ctx);
21136   return res;
21137 }
21138 
partial_schedule()21139 isl::multi_union_pw_aff schedule_node_band::partial_schedule() const
21140 {
21141   if (!ptr)
21142     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21143   auto saved_ctx = ctx();
21144   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21145   auto res = isl_schedule_node_band_get_partial_schedule(get());
21146   if (!res)
21147     exception::throw_last_error(saved_ctx);
21148   return manage(res);
21149 }
21150 
get_partial_schedule()21151 isl::multi_union_pw_aff schedule_node_band::get_partial_schedule() const
21152 {
21153   return partial_schedule();
21154 }
21155 
permutable()21156 bool schedule_node_band::permutable() const
21157 {
21158   if (!ptr)
21159     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21160   auto saved_ctx = ctx();
21161   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21162   auto res = isl_schedule_node_band_get_permutable(get());
21163   if (res < 0)
21164     exception::throw_last_error(saved_ctx);
21165   return res;
21166 }
21167 
get_permutable()21168 bool schedule_node_band::get_permutable() const
21169 {
21170   return permutable();
21171 }
21172 
scale(isl::multi_val mv)21173 schedule_node_band schedule_node_band::scale(isl::multi_val mv) const
21174 {
21175   if (!ptr || mv.is_null())
21176     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21177   auto saved_ctx = ctx();
21178   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21179   auto res = isl_schedule_node_band_scale(copy(), mv.release());
21180   if (!res)
21181     exception::throw_last_error(saved_ctx);
21182   return manage(res).as<schedule_node_band>();
21183 }
21184 
scale_down(isl::multi_val mv)21185 schedule_node_band schedule_node_band::scale_down(isl::multi_val mv) const
21186 {
21187   if (!ptr || mv.is_null())
21188     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21189   auto saved_ctx = ctx();
21190   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21191   auto res = isl_schedule_node_band_scale_down(copy(), mv.release());
21192   if (!res)
21193     exception::throw_last_error(saved_ctx);
21194   return manage(res).as<schedule_node_band>();
21195 }
21196 
set_ast_build_options(isl::union_set options)21197 schedule_node_band schedule_node_band::set_ast_build_options(isl::union_set options) const
21198 {
21199   if (!ptr || options.is_null())
21200     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21201   auto saved_ctx = ctx();
21202   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21203   auto res = isl_schedule_node_band_set_ast_build_options(copy(), options.release());
21204   if (!res)
21205     exception::throw_last_error(saved_ctx);
21206   return manage(res).as<schedule_node_band>();
21207 }
21208 
set_permutable(int permutable)21209 schedule_node_band schedule_node_band::set_permutable(int permutable) const
21210 {
21211   if (!ptr)
21212     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21213   auto saved_ctx = ctx();
21214   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21215   auto res = isl_schedule_node_band_set_permutable(copy(), permutable);
21216   if (!res)
21217     exception::throw_last_error(saved_ctx);
21218   return manage(res).as<schedule_node_band>();
21219 }
21220 
shift(isl::multi_union_pw_aff shift)21221 schedule_node_band schedule_node_band::shift(isl::multi_union_pw_aff shift) const
21222 {
21223   if (!ptr || shift.is_null())
21224     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21225   auto saved_ctx = ctx();
21226   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21227   auto res = isl_schedule_node_band_shift(copy(), shift.release());
21228   if (!res)
21229     exception::throw_last_error(saved_ctx);
21230   return manage(res).as<schedule_node_band>();
21231 }
21232 
split(int pos)21233 schedule_node_band schedule_node_band::split(int pos) const
21234 {
21235   if (!ptr)
21236     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21237   auto saved_ctx = ctx();
21238   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21239   auto res = isl_schedule_node_band_split(copy(), pos);
21240   if (!res)
21241     exception::throw_last_error(saved_ctx);
21242   return manage(res).as<schedule_node_band>();
21243 }
21244 
tile(isl::multi_val sizes)21245 schedule_node_band schedule_node_band::tile(isl::multi_val sizes) const
21246 {
21247   if (!ptr || sizes.is_null())
21248     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21249   auto saved_ctx = ctx();
21250   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21251   auto res = isl_schedule_node_band_tile(copy(), sizes.release());
21252   if (!res)
21253     exception::throw_last_error(saved_ctx);
21254   return manage(res).as<schedule_node_band>();
21255 }
21256 
member_set_ast_loop_default(int pos)21257 schedule_node_band schedule_node_band::member_set_ast_loop_default(int pos) const
21258 {
21259   if (!ptr)
21260     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21261   auto saved_ctx = ctx();
21262   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21263   auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_default);
21264   if (!res)
21265     exception::throw_last_error(saved_ctx);
21266   return manage(res).as<schedule_node_band>();
21267 }
21268 
member_set_ast_loop_atomic(int pos)21269 schedule_node_band schedule_node_band::member_set_ast_loop_atomic(int pos) const
21270 {
21271   if (!ptr)
21272     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21273   auto saved_ctx = ctx();
21274   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21275   auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_atomic);
21276   if (!res)
21277     exception::throw_last_error(saved_ctx);
21278   return manage(res).as<schedule_node_band>();
21279 }
21280 
member_set_ast_loop_unroll(int pos)21281 schedule_node_band schedule_node_band::member_set_ast_loop_unroll(int pos) const
21282 {
21283   if (!ptr)
21284     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21285   auto saved_ctx = ctx();
21286   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21287   auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_unroll);
21288   if (!res)
21289     exception::throw_last_error(saved_ctx);
21290   return manage(res).as<schedule_node_band>();
21291 }
21292 
member_set_ast_loop_separate(int pos)21293 schedule_node_band schedule_node_band::member_set_ast_loop_separate(int pos) const
21294 {
21295   if (!ptr)
21296     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21297   auto saved_ctx = ctx();
21298   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21299   auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_separate);
21300   if (!res)
21301     exception::throw_last_error(saved_ctx);
21302   return manage(res).as<schedule_node_band>();
21303 }
21304 
21305 inline std::ostream &operator<<(std::ostream &os, const schedule_node_band &obj)
21306 {
21307   if (!obj.get())
21308     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21309   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21310   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21311   char *str = isl_schedule_node_to_str(obj.get());
21312   if (!str)
21313     exception::throw_last_error(saved_ctx);
21314   os << str;
21315   free(str);
21316   return os;
21317 }
21318 
21319 // implementations for isl::schedule_node_context
schedule_node_context()21320 schedule_node_context::schedule_node_context()
21321     : schedule_node() {}
21322 
schedule_node_context(const schedule_node_context & obj)21323 schedule_node_context::schedule_node_context(const schedule_node_context &obj)
21324     : schedule_node(obj)
21325 {
21326 }
21327 
schedule_node_context(__isl_take isl_schedule_node * ptr)21328 schedule_node_context::schedule_node_context(__isl_take isl_schedule_node *ptr)
21329     : schedule_node(ptr) {}
21330 
21331 schedule_node_context &schedule_node_context::operator=(schedule_node_context obj) {
21332   std::swap(this->ptr, obj.ptr);
21333   return *this;
21334 }
21335 
ctx()21336 isl::ctx schedule_node_context::ctx() const {
21337   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21338 }
21339 
context()21340 isl::set schedule_node_context::context() const
21341 {
21342   if (!ptr)
21343     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21344   auto saved_ctx = ctx();
21345   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21346   auto res = isl_schedule_node_context_get_context(get());
21347   if (!res)
21348     exception::throw_last_error(saved_ctx);
21349   return manage(res);
21350 }
21351 
get_context()21352 isl::set schedule_node_context::get_context() const
21353 {
21354   return context();
21355 }
21356 
21357 inline std::ostream &operator<<(std::ostream &os, const schedule_node_context &obj)
21358 {
21359   if (!obj.get())
21360     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21361   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21362   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21363   char *str = isl_schedule_node_to_str(obj.get());
21364   if (!str)
21365     exception::throw_last_error(saved_ctx);
21366   os << str;
21367   free(str);
21368   return os;
21369 }
21370 
21371 // implementations for isl::schedule_node_domain
schedule_node_domain()21372 schedule_node_domain::schedule_node_domain()
21373     : schedule_node() {}
21374 
schedule_node_domain(const schedule_node_domain & obj)21375 schedule_node_domain::schedule_node_domain(const schedule_node_domain &obj)
21376     : schedule_node(obj)
21377 {
21378 }
21379 
schedule_node_domain(__isl_take isl_schedule_node * ptr)21380 schedule_node_domain::schedule_node_domain(__isl_take isl_schedule_node *ptr)
21381     : schedule_node(ptr) {}
21382 
21383 schedule_node_domain &schedule_node_domain::operator=(schedule_node_domain obj) {
21384   std::swap(this->ptr, obj.ptr);
21385   return *this;
21386 }
21387 
ctx()21388 isl::ctx schedule_node_domain::ctx() const {
21389   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21390 }
21391 
domain()21392 isl::union_set schedule_node_domain::domain() const
21393 {
21394   if (!ptr)
21395     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21396   auto saved_ctx = ctx();
21397   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21398   auto res = isl_schedule_node_domain_get_domain(get());
21399   if (!res)
21400     exception::throw_last_error(saved_ctx);
21401   return manage(res);
21402 }
21403 
get_domain()21404 isl::union_set schedule_node_domain::get_domain() const
21405 {
21406   return domain();
21407 }
21408 
21409 inline std::ostream &operator<<(std::ostream &os, const schedule_node_domain &obj)
21410 {
21411   if (!obj.get())
21412     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21413   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21414   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21415   char *str = isl_schedule_node_to_str(obj.get());
21416   if (!str)
21417     exception::throw_last_error(saved_ctx);
21418   os << str;
21419   free(str);
21420   return os;
21421 }
21422 
21423 // implementations for isl::schedule_node_expansion
schedule_node_expansion()21424 schedule_node_expansion::schedule_node_expansion()
21425     : schedule_node() {}
21426 
schedule_node_expansion(const schedule_node_expansion & obj)21427 schedule_node_expansion::schedule_node_expansion(const schedule_node_expansion &obj)
21428     : schedule_node(obj)
21429 {
21430 }
21431 
schedule_node_expansion(__isl_take isl_schedule_node * ptr)21432 schedule_node_expansion::schedule_node_expansion(__isl_take isl_schedule_node *ptr)
21433     : schedule_node(ptr) {}
21434 
21435 schedule_node_expansion &schedule_node_expansion::operator=(schedule_node_expansion obj) {
21436   std::swap(this->ptr, obj.ptr);
21437   return *this;
21438 }
21439 
ctx()21440 isl::ctx schedule_node_expansion::ctx() const {
21441   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21442 }
21443 
contraction()21444 isl::union_pw_multi_aff schedule_node_expansion::contraction() const
21445 {
21446   if (!ptr)
21447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21448   auto saved_ctx = ctx();
21449   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21450   auto res = isl_schedule_node_expansion_get_contraction(get());
21451   if (!res)
21452     exception::throw_last_error(saved_ctx);
21453   return manage(res);
21454 }
21455 
get_contraction()21456 isl::union_pw_multi_aff schedule_node_expansion::get_contraction() const
21457 {
21458   return contraction();
21459 }
21460 
expansion()21461 isl::union_map schedule_node_expansion::expansion() const
21462 {
21463   if (!ptr)
21464     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21465   auto saved_ctx = ctx();
21466   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21467   auto res = isl_schedule_node_expansion_get_expansion(get());
21468   if (!res)
21469     exception::throw_last_error(saved_ctx);
21470   return manage(res);
21471 }
21472 
get_expansion()21473 isl::union_map schedule_node_expansion::get_expansion() const
21474 {
21475   return expansion();
21476 }
21477 
21478 inline std::ostream &operator<<(std::ostream &os, const schedule_node_expansion &obj)
21479 {
21480   if (!obj.get())
21481     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21482   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21483   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21484   char *str = isl_schedule_node_to_str(obj.get());
21485   if (!str)
21486     exception::throw_last_error(saved_ctx);
21487   os << str;
21488   free(str);
21489   return os;
21490 }
21491 
21492 // implementations for isl::schedule_node_extension
schedule_node_extension()21493 schedule_node_extension::schedule_node_extension()
21494     : schedule_node() {}
21495 
schedule_node_extension(const schedule_node_extension & obj)21496 schedule_node_extension::schedule_node_extension(const schedule_node_extension &obj)
21497     : schedule_node(obj)
21498 {
21499 }
21500 
schedule_node_extension(__isl_take isl_schedule_node * ptr)21501 schedule_node_extension::schedule_node_extension(__isl_take isl_schedule_node *ptr)
21502     : schedule_node(ptr) {}
21503 
21504 schedule_node_extension &schedule_node_extension::operator=(schedule_node_extension obj) {
21505   std::swap(this->ptr, obj.ptr);
21506   return *this;
21507 }
21508 
ctx()21509 isl::ctx schedule_node_extension::ctx() const {
21510   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21511 }
21512 
extension()21513 isl::union_map schedule_node_extension::extension() const
21514 {
21515   if (!ptr)
21516     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21517   auto saved_ctx = ctx();
21518   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21519   auto res = isl_schedule_node_extension_get_extension(get());
21520   if (!res)
21521     exception::throw_last_error(saved_ctx);
21522   return manage(res);
21523 }
21524 
get_extension()21525 isl::union_map schedule_node_extension::get_extension() const
21526 {
21527   return extension();
21528 }
21529 
21530 inline std::ostream &operator<<(std::ostream &os, const schedule_node_extension &obj)
21531 {
21532   if (!obj.get())
21533     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21534   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21535   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21536   char *str = isl_schedule_node_to_str(obj.get());
21537   if (!str)
21538     exception::throw_last_error(saved_ctx);
21539   os << str;
21540   free(str);
21541   return os;
21542 }
21543 
21544 // implementations for isl::schedule_node_filter
schedule_node_filter()21545 schedule_node_filter::schedule_node_filter()
21546     : schedule_node() {}
21547 
schedule_node_filter(const schedule_node_filter & obj)21548 schedule_node_filter::schedule_node_filter(const schedule_node_filter &obj)
21549     : schedule_node(obj)
21550 {
21551 }
21552 
schedule_node_filter(__isl_take isl_schedule_node * ptr)21553 schedule_node_filter::schedule_node_filter(__isl_take isl_schedule_node *ptr)
21554     : schedule_node(ptr) {}
21555 
21556 schedule_node_filter &schedule_node_filter::operator=(schedule_node_filter obj) {
21557   std::swap(this->ptr, obj.ptr);
21558   return *this;
21559 }
21560 
ctx()21561 isl::ctx schedule_node_filter::ctx() const {
21562   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21563 }
21564 
filter()21565 isl::union_set schedule_node_filter::filter() const
21566 {
21567   if (!ptr)
21568     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21569   auto saved_ctx = ctx();
21570   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21571   auto res = isl_schedule_node_filter_get_filter(get());
21572   if (!res)
21573     exception::throw_last_error(saved_ctx);
21574   return manage(res);
21575 }
21576 
get_filter()21577 isl::union_set schedule_node_filter::get_filter() const
21578 {
21579   return filter();
21580 }
21581 
21582 inline std::ostream &operator<<(std::ostream &os, const schedule_node_filter &obj)
21583 {
21584   if (!obj.get())
21585     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21586   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21587   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21588   char *str = isl_schedule_node_to_str(obj.get());
21589   if (!str)
21590     exception::throw_last_error(saved_ctx);
21591   os << str;
21592   free(str);
21593   return os;
21594 }
21595 
21596 // implementations for isl::schedule_node_guard
schedule_node_guard()21597 schedule_node_guard::schedule_node_guard()
21598     : schedule_node() {}
21599 
schedule_node_guard(const schedule_node_guard & obj)21600 schedule_node_guard::schedule_node_guard(const schedule_node_guard &obj)
21601     : schedule_node(obj)
21602 {
21603 }
21604 
schedule_node_guard(__isl_take isl_schedule_node * ptr)21605 schedule_node_guard::schedule_node_guard(__isl_take isl_schedule_node *ptr)
21606     : schedule_node(ptr) {}
21607 
21608 schedule_node_guard &schedule_node_guard::operator=(schedule_node_guard obj) {
21609   std::swap(this->ptr, obj.ptr);
21610   return *this;
21611 }
21612 
ctx()21613 isl::ctx schedule_node_guard::ctx() const {
21614   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21615 }
21616 
guard()21617 isl::set schedule_node_guard::guard() const
21618 {
21619   if (!ptr)
21620     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21621   auto saved_ctx = ctx();
21622   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21623   auto res = isl_schedule_node_guard_get_guard(get());
21624   if (!res)
21625     exception::throw_last_error(saved_ctx);
21626   return manage(res);
21627 }
21628 
get_guard()21629 isl::set schedule_node_guard::get_guard() const
21630 {
21631   return guard();
21632 }
21633 
21634 inline std::ostream &operator<<(std::ostream &os, const schedule_node_guard &obj)
21635 {
21636   if (!obj.get())
21637     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21638   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21639   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21640   char *str = isl_schedule_node_to_str(obj.get());
21641   if (!str)
21642     exception::throw_last_error(saved_ctx);
21643   os << str;
21644   free(str);
21645   return os;
21646 }
21647 
21648 // implementations for isl::schedule_node_leaf
schedule_node_leaf()21649 schedule_node_leaf::schedule_node_leaf()
21650     : schedule_node() {}
21651 
schedule_node_leaf(const schedule_node_leaf & obj)21652 schedule_node_leaf::schedule_node_leaf(const schedule_node_leaf &obj)
21653     : schedule_node(obj)
21654 {
21655 }
21656 
schedule_node_leaf(__isl_take isl_schedule_node * ptr)21657 schedule_node_leaf::schedule_node_leaf(__isl_take isl_schedule_node *ptr)
21658     : schedule_node(ptr) {}
21659 
21660 schedule_node_leaf &schedule_node_leaf::operator=(schedule_node_leaf obj) {
21661   std::swap(this->ptr, obj.ptr);
21662   return *this;
21663 }
21664 
ctx()21665 isl::ctx schedule_node_leaf::ctx() const {
21666   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21667 }
21668 
21669 inline std::ostream &operator<<(std::ostream &os, const schedule_node_leaf &obj)
21670 {
21671   if (!obj.get())
21672     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21673   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21674   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21675   char *str = isl_schedule_node_to_str(obj.get());
21676   if (!str)
21677     exception::throw_last_error(saved_ctx);
21678   os << str;
21679   free(str);
21680   return os;
21681 }
21682 
21683 // implementations for isl::schedule_node_mark
schedule_node_mark()21684 schedule_node_mark::schedule_node_mark()
21685     : schedule_node() {}
21686 
schedule_node_mark(const schedule_node_mark & obj)21687 schedule_node_mark::schedule_node_mark(const schedule_node_mark &obj)
21688     : schedule_node(obj)
21689 {
21690 }
21691 
schedule_node_mark(__isl_take isl_schedule_node * ptr)21692 schedule_node_mark::schedule_node_mark(__isl_take isl_schedule_node *ptr)
21693     : schedule_node(ptr) {}
21694 
21695 schedule_node_mark &schedule_node_mark::operator=(schedule_node_mark obj) {
21696   std::swap(this->ptr, obj.ptr);
21697   return *this;
21698 }
21699 
ctx()21700 isl::ctx schedule_node_mark::ctx() const {
21701   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21702 }
21703 
21704 inline std::ostream &operator<<(std::ostream &os, const schedule_node_mark &obj)
21705 {
21706   if (!obj.get())
21707     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21708   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21709   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21710   char *str = isl_schedule_node_to_str(obj.get());
21711   if (!str)
21712     exception::throw_last_error(saved_ctx);
21713   os << str;
21714   free(str);
21715   return os;
21716 }
21717 
21718 // implementations for isl::schedule_node_sequence
schedule_node_sequence()21719 schedule_node_sequence::schedule_node_sequence()
21720     : schedule_node() {}
21721 
schedule_node_sequence(const schedule_node_sequence & obj)21722 schedule_node_sequence::schedule_node_sequence(const schedule_node_sequence &obj)
21723     : schedule_node(obj)
21724 {
21725 }
21726 
schedule_node_sequence(__isl_take isl_schedule_node * ptr)21727 schedule_node_sequence::schedule_node_sequence(__isl_take isl_schedule_node *ptr)
21728     : schedule_node(ptr) {}
21729 
21730 schedule_node_sequence &schedule_node_sequence::operator=(schedule_node_sequence obj) {
21731   std::swap(this->ptr, obj.ptr);
21732   return *this;
21733 }
21734 
ctx()21735 isl::ctx schedule_node_sequence::ctx() const {
21736   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21737 }
21738 
21739 inline std::ostream &operator<<(std::ostream &os, const schedule_node_sequence &obj)
21740 {
21741   if (!obj.get())
21742     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21743   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21744   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21745   char *str = isl_schedule_node_to_str(obj.get());
21746   if (!str)
21747     exception::throw_last_error(saved_ctx);
21748   os << str;
21749   free(str);
21750   return os;
21751 }
21752 
21753 // implementations for isl::schedule_node_set
schedule_node_set()21754 schedule_node_set::schedule_node_set()
21755     : schedule_node() {}
21756 
schedule_node_set(const schedule_node_set & obj)21757 schedule_node_set::schedule_node_set(const schedule_node_set &obj)
21758     : schedule_node(obj)
21759 {
21760 }
21761 
schedule_node_set(__isl_take isl_schedule_node * ptr)21762 schedule_node_set::schedule_node_set(__isl_take isl_schedule_node *ptr)
21763     : schedule_node(ptr) {}
21764 
21765 schedule_node_set &schedule_node_set::operator=(schedule_node_set obj) {
21766   std::swap(this->ptr, obj.ptr);
21767   return *this;
21768 }
21769 
ctx()21770 isl::ctx schedule_node_set::ctx() const {
21771   return isl::ctx(isl_schedule_node_get_ctx(ptr));
21772 }
21773 
21774 inline std::ostream &operator<<(std::ostream &os, const schedule_node_set &obj)
21775 {
21776   if (!obj.get())
21777     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21778   auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
21779   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21780   char *str = isl_schedule_node_to_str(obj.get());
21781   if (!str)
21782     exception::throw_last_error(saved_ctx);
21783   os << str;
21784   free(str);
21785   return os;
21786 }
21787 
21788 // implementations for isl::set
manage(__isl_take isl_set * ptr)21789 set manage(__isl_take isl_set *ptr) {
21790   if (!ptr)
21791     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21792   return set(ptr);
21793 }
manage_copy(__isl_keep isl_set * ptr)21794 set manage_copy(__isl_keep isl_set *ptr) {
21795   if (!ptr)
21796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21797   auto saved_ctx = isl_set_get_ctx(ptr);
21798   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21799   ptr = isl_set_copy(ptr);
21800   if (!ptr)
21801     exception::throw_last_error(saved_ctx);
21802   return set(ptr);
21803 }
21804 
set()21805 set::set()
21806     : ptr(nullptr) {}
21807 
set(const set & obj)21808 set::set(const set &obj)
21809     : ptr(nullptr)
21810 {
21811   if (!obj.ptr)
21812     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21813   auto saved_ctx = isl_set_get_ctx(obj.ptr);
21814   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21815   ptr = obj.copy();
21816   if (!ptr)
21817     exception::throw_last_error(saved_ctx);
21818 }
21819 
set(__isl_take isl_set * ptr)21820 set::set(__isl_take isl_set *ptr)
21821     : ptr(ptr) {}
21822 
set(isl::basic_set bset)21823 set::set(isl::basic_set bset)
21824 {
21825   if (bset.is_null())
21826     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21827   auto saved_ctx = bset.ctx();
21828   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21829   auto res = isl_set_from_basic_set(bset.release());
21830   if (!res)
21831     exception::throw_last_error(saved_ctx);
21832   ptr = res;
21833 }
21834 
set(isl::point pnt)21835 set::set(isl::point pnt)
21836 {
21837   if (pnt.is_null())
21838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21839   auto saved_ctx = pnt.ctx();
21840   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21841   auto res = isl_set_from_point(pnt.release());
21842   if (!res)
21843     exception::throw_last_error(saved_ctx);
21844   ptr = res;
21845 }
21846 
set(isl::ctx ctx,const std::string & str)21847 set::set(isl::ctx ctx, const std::string &str)
21848 {
21849   auto saved_ctx = ctx;
21850   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21851   auto res = isl_set_read_from_str(ctx.release(), str.c_str());
21852   if (!res)
21853     exception::throw_last_error(saved_ctx);
21854   ptr = res;
21855 }
21856 
21857 set &set::operator=(set obj) {
21858   std::swap(this->ptr, obj.ptr);
21859   return *this;
21860 }
21861 
~set()21862 set::~set() {
21863   if (ptr)
21864     isl_set_free(ptr);
21865 }
21866 
copy()21867 __isl_give isl_set *set::copy() const & {
21868   return isl_set_copy(ptr);
21869 }
21870 
get()21871 __isl_keep isl_set *set::get() const {
21872   return ptr;
21873 }
21874 
release()21875 __isl_give isl_set *set::release() {
21876   isl_set *tmp = ptr;
21877   ptr = nullptr;
21878   return tmp;
21879 }
21880 
is_null()21881 bool set::is_null() const {
21882   return ptr == nullptr;
21883 }
21884 
ctx()21885 isl::ctx set::ctx() const {
21886   return isl::ctx(isl_set_get_ctx(ptr));
21887 }
21888 
affine_hull()21889 isl::basic_set set::affine_hull() const
21890 {
21891   if (!ptr)
21892     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21893   auto saved_ctx = ctx();
21894   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21895   auto res = isl_set_affine_hull(copy());
21896   if (!res)
21897     exception::throw_last_error(saved_ctx);
21898   return manage(res);
21899 }
21900 
apply(isl::map map)21901 isl::set set::apply(isl::map map) const
21902 {
21903   if (!ptr || map.is_null())
21904     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21905   auto saved_ctx = ctx();
21906   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21907   auto res = isl_set_apply(copy(), map.release());
21908   if (!res)
21909     exception::throw_last_error(saved_ctx);
21910   return manage(res);
21911 }
21912 
apply(const isl::union_map & umap)21913 isl::union_set set::apply(const isl::union_map &umap) const
21914 {
21915   if (!ptr)
21916     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21917   return isl::union_set(*this).apply(umap);
21918 }
21919 
apply(const isl::basic_map & map)21920 isl::set set::apply(const isl::basic_map &map) const
21921 {
21922   if (!ptr)
21923     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21924   return this->apply(isl::map(map));
21925 }
21926 
as_pw_multi_aff()21927 isl::pw_multi_aff set::as_pw_multi_aff() const
21928 {
21929   if (!ptr)
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_set_as_pw_multi_aff(copy());
21934   if (!res)
21935     exception::throw_last_error(saved_ctx);
21936   return manage(res);
21937 }
21938 
as_set()21939 isl::set set::as_set() const
21940 {
21941   if (!ptr)
21942     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21943   return isl::union_set(*this).as_set();
21944 }
21945 
bind(isl::multi_id tuple)21946 isl::set set::bind(isl::multi_id tuple) const
21947 {
21948   if (!ptr || tuple.is_null())
21949     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21950   auto saved_ctx = ctx();
21951   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21952   auto res = isl_set_bind(copy(), tuple.release());
21953   if (!res)
21954     exception::throw_last_error(saved_ctx);
21955   return manage(res);
21956 }
21957 
coalesce()21958 isl::set set::coalesce() const
21959 {
21960   if (!ptr)
21961     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21962   auto saved_ctx = ctx();
21963   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21964   auto res = isl_set_coalesce(copy());
21965   if (!res)
21966     exception::throw_last_error(saved_ctx);
21967   return manage(res);
21968 }
21969 
complement()21970 isl::set set::complement() const
21971 {
21972   if (!ptr)
21973     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21974   auto saved_ctx = ctx();
21975   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21976   auto res = isl_set_complement(copy());
21977   if (!res)
21978     exception::throw_last_error(saved_ctx);
21979   return manage(res);
21980 }
21981 
compute_divs()21982 isl::union_set set::compute_divs() const
21983 {
21984   if (!ptr)
21985     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21986   return isl::union_set(*this).compute_divs();
21987 }
21988 
detect_equalities()21989 isl::set set::detect_equalities() const
21990 {
21991   if (!ptr)
21992     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21993   auto saved_ctx = ctx();
21994   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21995   auto res = isl_set_detect_equalities(copy());
21996   if (!res)
21997     exception::throw_last_error(saved_ctx);
21998   return manage(res);
21999 }
22000 
dim_max_val(int pos)22001 isl::val set::dim_max_val(int pos) const
22002 {
22003   if (!ptr)
22004     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22005   auto saved_ctx = ctx();
22006   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22007   auto res = isl_set_dim_max_val(copy(), pos);
22008   if (!res)
22009     exception::throw_last_error(saved_ctx);
22010   return manage(res);
22011 }
22012 
dim_min_val(int pos)22013 isl::val set::dim_min_val(int pos) const
22014 {
22015   if (!ptr)
22016     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22017   auto saved_ctx = ctx();
22018   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22019   auto res = isl_set_dim_min_val(copy(), pos);
22020   if (!res)
22021     exception::throw_last_error(saved_ctx);
22022   return manage(res);
22023 }
22024 
empty(isl::space space)22025 isl::set set::empty(isl::space space)
22026 {
22027   if (space.is_null())
22028     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22029   auto saved_ctx = space.ctx();
22030   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22031   auto res = isl_set_empty(space.release());
22032   if (!res)
22033     exception::throw_last_error(saved_ctx);
22034   return manage(res);
22035 }
22036 
every_set(const std::function<bool (isl::set)> & test)22037 bool set::every_set(const std::function<bool(isl::set)> &test) const
22038 {
22039   if (!ptr)
22040     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22041   return isl::union_set(*this).every_set(test);
22042 }
22043 
extract_set(const isl::space & space)22044 isl::set set::extract_set(const isl::space &space) const
22045 {
22046   if (!ptr)
22047     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22048   return isl::union_set(*this).extract_set(space);
22049 }
22050 
flatten()22051 isl::set set::flatten() const
22052 {
22053   if (!ptr)
22054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22055   auto saved_ctx = ctx();
22056   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22057   auto res = isl_set_flatten(copy());
22058   if (!res)
22059     exception::throw_last_error(saved_ctx);
22060   return manage(res);
22061 }
22062 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)22063 void set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
22064 {
22065   if (!ptr)
22066     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22067   auto saved_ctx = ctx();
22068   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22069   struct fn_data {
22070     std::function<void(isl::basic_set)> func;
22071     std::exception_ptr eptr;
22072   } fn_data = { fn };
22073   auto fn_lambda = [](isl_basic_set *arg_0, void *arg_1) -> isl_stat {
22074     auto *data = static_cast<struct fn_data *>(arg_1);
22075     ISL_CPP_TRY {
22076       (data->func)(manage(arg_0));
22077       return isl_stat_ok;
22078     } ISL_CPP_CATCH_ALL {
22079       data->eptr = std::current_exception();
22080       return isl_stat_error;
22081     }
22082   };
22083   auto res = isl_set_foreach_basic_set(get(), fn_lambda, &fn_data);
22084   if (fn_data.eptr)
22085     std::rethrow_exception(fn_data.eptr);
22086   if (res < 0)
22087     exception::throw_last_error(saved_ctx);
22088   return;
22089 }
22090 
foreach_point(const std::function<void (isl::point)> & fn)22091 void set::foreach_point(const std::function<void(isl::point)> &fn) const
22092 {
22093   if (!ptr)
22094     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22095   auto saved_ctx = ctx();
22096   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22097   struct fn_data {
22098     std::function<void(isl::point)> func;
22099     std::exception_ptr eptr;
22100   } fn_data = { fn };
22101   auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
22102     auto *data = static_cast<struct fn_data *>(arg_1);
22103     ISL_CPP_TRY {
22104       (data->func)(manage(arg_0));
22105       return isl_stat_ok;
22106     } ISL_CPP_CATCH_ALL {
22107       data->eptr = std::current_exception();
22108       return isl_stat_error;
22109     }
22110   };
22111   auto res = isl_set_foreach_point(get(), fn_lambda, &fn_data);
22112   if (fn_data.eptr)
22113     std::rethrow_exception(fn_data.eptr);
22114   if (res < 0)
22115     exception::throw_last_error(saved_ctx);
22116   return;
22117 }
22118 
foreach_set(const std::function<void (isl::set)> & fn)22119 void set::foreach_set(const std::function<void(isl::set)> &fn) const
22120 {
22121   if (!ptr)
22122     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22123   return isl::union_set(*this).foreach_set(fn);
22124 }
22125 
gist(isl::set context)22126 isl::set set::gist(isl::set context) const
22127 {
22128   if (!ptr || context.is_null())
22129     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22130   auto saved_ctx = ctx();
22131   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22132   auto res = isl_set_gist(copy(), context.release());
22133   if (!res)
22134     exception::throw_last_error(saved_ctx);
22135   return manage(res);
22136 }
22137 
gist(const isl::union_set & context)22138 isl::union_set set::gist(const isl::union_set &context) const
22139 {
22140   if (!ptr)
22141     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22142   return isl::union_set(*this).gist(context);
22143 }
22144 
gist(const isl::basic_set & context)22145 isl::set set::gist(const isl::basic_set &context) const
22146 {
22147   if (!ptr)
22148     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22149   return this->gist(isl::set(context));
22150 }
22151 
gist(const isl::point & context)22152 isl::set set::gist(const isl::point &context) const
22153 {
22154   if (!ptr)
22155     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22156   return this->gist(isl::set(context));
22157 }
22158 
gist_params(const isl::set & set)22159 isl::union_set set::gist_params(const isl::set &set) const
22160 {
22161   if (!ptr)
22162     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22163   return isl::union_set(*this).gist_params(set);
22164 }
22165 
identity()22166 isl::map set::identity() const
22167 {
22168   if (!ptr)
22169     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22170   auto saved_ctx = ctx();
22171   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22172   auto res = isl_set_identity(copy());
22173   if (!res)
22174     exception::throw_last_error(saved_ctx);
22175   return manage(res);
22176 }
22177 
indicator_function()22178 isl::pw_aff set::indicator_function() const
22179 {
22180   if (!ptr)
22181     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22182   auto saved_ctx = ctx();
22183   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22184   auto res = isl_set_indicator_function(copy());
22185   if (!res)
22186     exception::throw_last_error(saved_ctx);
22187   return manage(res);
22188 }
22189 
insert_domain(isl::space domain)22190 isl::map set::insert_domain(isl::space domain) const
22191 {
22192   if (!ptr || domain.is_null())
22193     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22194   auto saved_ctx = ctx();
22195   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22196   auto res = isl_set_insert_domain(copy(), domain.release());
22197   if (!res)
22198     exception::throw_last_error(saved_ctx);
22199   return manage(res);
22200 }
22201 
intersect(isl::set set2)22202 isl::set set::intersect(isl::set set2) const
22203 {
22204   if (!ptr || set2.is_null())
22205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22206   auto saved_ctx = ctx();
22207   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22208   auto res = isl_set_intersect(copy(), set2.release());
22209   if (!res)
22210     exception::throw_last_error(saved_ctx);
22211   return manage(res);
22212 }
22213 
intersect(const isl::union_set & uset2)22214 isl::union_set set::intersect(const isl::union_set &uset2) const
22215 {
22216   if (!ptr)
22217     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22218   return isl::union_set(*this).intersect(uset2);
22219 }
22220 
intersect(const isl::basic_set & set2)22221 isl::set set::intersect(const isl::basic_set &set2) const
22222 {
22223   if (!ptr)
22224     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22225   return this->intersect(isl::set(set2));
22226 }
22227 
intersect(const isl::point & set2)22228 isl::set set::intersect(const isl::point &set2) const
22229 {
22230   if (!ptr)
22231     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22232   return this->intersect(isl::set(set2));
22233 }
22234 
intersect_params(isl::set params)22235 isl::set set::intersect_params(isl::set params) const
22236 {
22237   if (!ptr || params.is_null())
22238     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22239   auto saved_ctx = ctx();
22240   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22241   auto res = isl_set_intersect_params(copy(), params.release());
22242   if (!res)
22243     exception::throw_last_error(saved_ctx);
22244   return manage(res);
22245 }
22246 
involves_locals()22247 bool set::involves_locals() const
22248 {
22249   if (!ptr)
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_set_involves_locals(get());
22254   if (res < 0)
22255     exception::throw_last_error(saved_ctx);
22256   return res;
22257 }
22258 
is_disjoint(const isl::set & set2)22259 bool set::is_disjoint(const isl::set &set2) const
22260 {
22261   if (!ptr || set2.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_set_is_disjoint(get(), set2.get());
22266   if (res < 0)
22267     exception::throw_last_error(saved_ctx);
22268   return res;
22269 }
22270 
is_disjoint(const isl::union_set & uset2)22271 bool set::is_disjoint(const isl::union_set &uset2) const
22272 {
22273   if (!ptr)
22274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22275   return isl::union_set(*this).is_disjoint(uset2);
22276 }
22277 
is_disjoint(const isl::basic_set & set2)22278 bool set::is_disjoint(const isl::basic_set &set2) const
22279 {
22280   if (!ptr)
22281     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22282   return this->is_disjoint(isl::set(set2));
22283 }
22284 
is_disjoint(const isl::point & set2)22285 bool set::is_disjoint(const isl::point &set2) const
22286 {
22287   if (!ptr)
22288     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22289   return this->is_disjoint(isl::set(set2));
22290 }
22291 
is_empty()22292 bool set::is_empty() const
22293 {
22294   if (!ptr)
22295     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22296   auto saved_ctx = ctx();
22297   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22298   auto res = isl_set_is_empty(get());
22299   if (res < 0)
22300     exception::throw_last_error(saved_ctx);
22301   return res;
22302 }
22303 
is_equal(const isl::set & set2)22304 bool set::is_equal(const isl::set &set2) const
22305 {
22306   if (!ptr || set2.is_null())
22307     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22308   auto saved_ctx = ctx();
22309   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22310   auto res = isl_set_is_equal(get(), set2.get());
22311   if (res < 0)
22312     exception::throw_last_error(saved_ctx);
22313   return res;
22314 }
22315 
is_equal(const isl::union_set & uset2)22316 bool set::is_equal(const isl::union_set &uset2) const
22317 {
22318   if (!ptr)
22319     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22320   return isl::union_set(*this).is_equal(uset2);
22321 }
22322 
is_equal(const isl::basic_set & set2)22323 bool set::is_equal(const isl::basic_set &set2) const
22324 {
22325   if (!ptr)
22326     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22327   return this->is_equal(isl::set(set2));
22328 }
22329 
is_equal(const isl::point & set2)22330 bool set::is_equal(const isl::point &set2) const
22331 {
22332   if (!ptr)
22333     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22334   return this->is_equal(isl::set(set2));
22335 }
22336 
is_singleton()22337 bool set::is_singleton() const
22338 {
22339   if (!ptr)
22340     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22341   auto saved_ctx = ctx();
22342   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22343   auto res = isl_set_is_singleton(get());
22344   if (res < 0)
22345     exception::throw_last_error(saved_ctx);
22346   return res;
22347 }
22348 
is_strict_subset(const isl::set & set2)22349 bool set::is_strict_subset(const isl::set &set2) const
22350 {
22351   if (!ptr || set2.is_null())
22352     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22353   auto saved_ctx = ctx();
22354   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22355   auto res = isl_set_is_strict_subset(get(), set2.get());
22356   if (res < 0)
22357     exception::throw_last_error(saved_ctx);
22358   return res;
22359 }
22360 
is_strict_subset(const isl::union_set & uset2)22361 bool set::is_strict_subset(const isl::union_set &uset2) const
22362 {
22363   if (!ptr)
22364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22365   return isl::union_set(*this).is_strict_subset(uset2);
22366 }
22367 
is_strict_subset(const isl::basic_set & set2)22368 bool set::is_strict_subset(const isl::basic_set &set2) const
22369 {
22370   if (!ptr)
22371     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22372   return this->is_strict_subset(isl::set(set2));
22373 }
22374 
is_strict_subset(const isl::point & set2)22375 bool set::is_strict_subset(const isl::point &set2) const
22376 {
22377   if (!ptr)
22378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22379   return this->is_strict_subset(isl::set(set2));
22380 }
22381 
is_subset(const isl::set & set2)22382 bool set::is_subset(const isl::set &set2) const
22383 {
22384   if (!ptr || set2.is_null())
22385     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22386   auto saved_ctx = ctx();
22387   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22388   auto res = isl_set_is_subset(get(), set2.get());
22389   if (res < 0)
22390     exception::throw_last_error(saved_ctx);
22391   return res;
22392 }
22393 
is_subset(const isl::union_set & uset2)22394 bool set::is_subset(const isl::union_set &uset2) const
22395 {
22396   if (!ptr)
22397     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22398   return isl::union_set(*this).is_subset(uset2);
22399 }
22400 
is_subset(const isl::basic_set & set2)22401 bool set::is_subset(const isl::basic_set &set2) const
22402 {
22403   if (!ptr)
22404     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22405   return this->is_subset(isl::set(set2));
22406 }
22407 
is_subset(const isl::point & set2)22408 bool set::is_subset(const isl::point &set2) const
22409 {
22410   if (!ptr)
22411     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22412   return this->is_subset(isl::set(set2));
22413 }
22414 
is_wrapping()22415 bool set::is_wrapping() const
22416 {
22417   if (!ptr)
22418     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22419   auto saved_ctx = ctx();
22420   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22421   auto res = isl_set_is_wrapping(get());
22422   if (res < 0)
22423     exception::throw_last_error(saved_ctx);
22424   return res;
22425 }
22426 
isa_set()22427 bool set::isa_set() const
22428 {
22429   if (!ptr)
22430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22431   return isl::union_set(*this).isa_set();
22432 }
22433 
lexmax()22434 isl::set set::lexmax() 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   auto res = isl_set_lexmax(copy());
22441   if (!res)
22442     exception::throw_last_error(saved_ctx);
22443   return manage(res);
22444 }
22445 
lexmax_pw_multi_aff()22446 isl::pw_multi_aff set::lexmax_pw_multi_aff() const
22447 {
22448   if (!ptr)
22449     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22450   auto saved_ctx = ctx();
22451   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22452   auto res = isl_set_lexmax_pw_multi_aff(copy());
22453   if (!res)
22454     exception::throw_last_error(saved_ctx);
22455   return manage(res);
22456 }
22457 
lexmin()22458 isl::set set::lexmin() const
22459 {
22460   if (!ptr)
22461     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22462   auto saved_ctx = ctx();
22463   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22464   auto res = isl_set_lexmin(copy());
22465   if (!res)
22466     exception::throw_last_error(saved_ctx);
22467   return manage(res);
22468 }
22469 
lexmin_pw_multi_aff()22470 isl::pw_multi_aff set::lexmin_pw_multi_aff() const
22471 {
22472   if (!ptr)
22473     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22474   auto saved_ctx = ctx();
22475   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22476   auto res = isl_set_lexmin_pw_multi_aff(copy());
22477   if (!res)
22478     exception::throw_last_error(saved_ctx);
22479   return manage(res);
22480 }
22481 
lower_bound(isl::multi_pw_aff lower)22482 isl::set set::lower_bound(isl::multi_pw_aff lower) const
22483 {
22484   if (!ptr || lower.is_null())
22485     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22486   auto saved_ctx = ctx();
22487   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22488   auto res = isl_set_lower_bound_multi_pw_aff(copy(), lower.release());
22489   if (!res)
22490     exception::throw_last_error(saved_ctx);
22491   return manage(res);
22492 }
22493 
lower_bound(isl::multi_val lower)22494 isl::set set::lower_bound(isl::multi_val lower) const
22495 {
22496   if (!ptr || lower.is_null())
22497     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22498   auto saved_ctx = ctx();
22499   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22500   auto res = isl_set_lower_bound_multi_val(copy(), lower.release());
22501   if (!res)
22502     exception::throw_last_error(saved_ctx);
22503   return manage(res);
22504 }
22505 
max_multi_pw_aff()22506 isl::multi_pw_aff set::max_multi_pw_aff() const
22507 {
22508   if (!ptr)
22509     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22510   auto saved_ctx = ctx();
22511   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22512   auto res = isl_set_max_multi_pw_aff(copy());
22513   if (!res)
22514     exception::throw_last_error(saved_ctx);
22515   return manage(res);
22516 }
22517 
max_val(const isl::aff & obj)22518 isl::val set::max_val(const isl::aff &obj) const
22519 {
22520   if (!ptr || obj.is_null())
22521     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22522   auto saved_ctx = ctx();
22523   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22524   auto res = isl_set_max_val(get(), obj.get());
22525   if (!res)
22526     exception::throw_last_error(saved_ctx);
22527   return manage(res);
22528 }
22529 
min_multi_pw_aff()22530 isl::multi_pw_aff set::min_multi_pw_aff() const
22531 {
22532   if (!ptr)
22533     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22534   auto saved_ctx = ctx();
22535   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22536   auto res = isl_set_min_multi_pw_aff(copy());
22537   if (!res)
22538     exception::throw_last_error(saved_ctx);
22539   return manage(res);
22540 }
22541 
min_val(const isl::aff & obj)22542 isl::val set::min_val(const isl::aff &obj) const
22543 {
22544   if (!ptr || obj.is_null())
22545     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22546   auto saved_ctx = ctx();
22547   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22548   auto res = isl_set_min_val(get(), obj.get());
22549   if (!res)
22550     exception::throw_last_error(saved_ctx);
22551   return manage(res);
22552 }
22553 
n_basic_set()22554 unsigned set::n_basic_set() const
22555 {
22556   if (!ptr)
22557     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22558   auto saved_ctx = ctx();
22559   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22560   auto res = isl_set_n_basic_set(get());
22561   if (res < 0)
22562     exception::throw_last_error(saved_ctx);
22563   return res;
22564 }
22565 
params()22566 isl::set set::params() const
22567 {
22568   if (!ptr)
22569     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22570   auto saved_ctx = ctx();
22571   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22572   auto res = isl_set_params(copy());
22573   if (!res)
22574     exception::throw_last_error(saved_ctx);
22575   return manage(res);
22576 }
22577 
plain_multi_val_if_fixed()22578 isl::multi_val set::plain_multi_val_if_fixed() const
22579 {
22580   if (!ptr)
22581     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22582   auto saved_ctx = ctx();
22583   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22584   auto res = isl_set_get_plain_multi_val_if_fixed(get());
22585   if (!res)
22586     exception::throw_last_error(saved_ctx);
22587   return manage(res);
22588 }
22589 
get_plain_multi_val_if_fixed()22590 isl::multi_val set::get_plain_multi_val_if_fixed() const
22591 {
22592   return plain_multi_val_if_fixed();
22593 }
22594 
polyhedral_hull()22595 isl::basic_set set::polyhedral_hull() const
22596 {
22597   if (!ptr)
22598     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22599   auto saved_ctx = ctx();
22600   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22601   auto res = isl_set_polyhedral_hull(copy());
22602   if (!res)
22603     exception::throw_last_error(saved_ctx);
22604   return manage(res);
22605 }
22606 
preimage(isl::multi_aff ma)22607 isl::set set::preimage(isl::multi_aff ma) const
22608 {
22609   if (!ptr || ma.is_null())
22610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22611   auto saved_ctx = ctx();
22612   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22613   auto res = isl_set_preimage_multi_aff(copy(), ma.release());
22614   if (!res)
22615     exception::throw_last_error(saved_ctx);
22616   return manage(res);
22617 }
22618 
preimage(isl::multi_pw_aff mpa)22619 isl::set set::preimage(isl::multi_pw_aff mpa) const
22620 {
22621   if (!ptr || mpa.is_null())
22622     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22623   auto saved_ctx = ctx();
22624   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22625   auto res = isl_set_preimage_multi_pw_aff(copy(), mpa.release());
22626   if (!res)
22627     exception::throw_last_error(saved_ctx);
22628   return manage(res);
22629 }
22630 
preimage(isl::pw_multi_aff pma)22631 isl::set set::preimage(isl::pw_multi_aff pma) const
22632 {
22633   if (!ptr || pma.is_null())
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_set_preimage_pw_multi_aff(copy(), pma.release());
22638   if (!res)
22639     exception::throw_last_error(saved_ctx);
22640   return manage(res);
22641 }
22642 
preimage(const isl::union_pw_multi_aff & upma)22643 isl::union_set set::preimage(const isl::union_pw_multi_aff &upma) const
22644 {
22645   if (!ptr)
22646     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22647   return isl::union_set(*this).preimage(upma);
22648 }
22649 
product(isl::set set2)22650 isl::set set::product(isl::set set2) const
22651 {
22652   if (!ptr || set2.is_null())
22653     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22654   auto saved_ctx = ctx();
22655   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22656   auto res = isl_set_product(copy(), set2.release());
22657   if (!res)
22658     exception::throw_last_error(saved_ctx);
22659   return manage(res);
22660 }
22661 
project_out_all_params()22662 isl::set set::project_out_all_params() const
22663 {
22664   if (!ptr)
22665     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22666   auto saved_ctx = ctx();
22667   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22668   auto res = isl_set_project_out_all_params(copy());
22669   if (!res)
22670     exception::throw_last_error(saved_ctx);
22671   return manage(res);
22672 }
22673 
project_out_param(isl::id id)22674 isl::set set::project_out_param(isl::id id) const
22675 {
22676   if (!ptr || id.is_null())
22677     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22678   auto saved_ctx = ctx();
22679   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22680   auto res = isl_set_project_out_param_id(copy(), id.release());
22681   if (!res)
22682     exception::throw_last_error(saved_ctx);
22683   return manage(res);
22684 }
22685 
project_out_param(const std::string & id)22686 isl::set set::project_out_param(const std::string &id) const
22687 {
22688   if (!ptr)
22689     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22690   return this->project_out_param(isl::id(ctx(), id));
22691 }
22692 
project_out_param(isl::id_list list)22693 isl::set set::project_out_param(isl::id_list list) const
22694 {
22695   if (!ptr || list.is_null())
22696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22697   auto saved_ctx = ctx();
22698   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22699   auto res = isl_set_project_out_param_id_list(copy(), list.release());
22700   if (!res)
22701     exception::throw_last_error(saved_ctx);
22702   return manage(res);
22703 }
22704 
pw_multi_aff_on_domain(isl::multi_val mv)22705 isl::pw_multi_aff set::pw_multi_aff_on_domain(isl::multi_val mv) const
22706 {
22707   if (!ptr || mv.is_null())
22708     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22709   auto saved_ctx = ctx();
22710   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22711   auto res = isl_set_pw_multi_aff_on_domain_multi_val(copy(), mv.release());
22712   if (!res)
22713     exception::throw_last_error(saved_ctx);
22714   return manage(res);
22715 }
22716 
sample()22717 isl::basic_set set::sample() 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_set_sample(copy());
22724   if (!res)
22725     exception::throw_last_error(saved_ctx);
22726   return manage(res);
22727 }
22728 
sample_point()22729 isl::point set::sample_point() 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_set_sample_point(copy());
22736   if (!res)
22737     exception::throw_last_error(saved_ctx);
22738   return manage(res);
22739 }
22740 
set_list()22741 isl::set_list set::set_list() const
22742 {
22743   if (!ptr)
22744     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22745   return isl::union_set(*this).set_list();
22746 }
22747 
simple_fixed_box_hull()22748 isl::fixed_box set::simple_fixed_box_hull() const
22749 {
22750   if (!ptr)
22751     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22752   auto saved_ctx = ctx();
22753   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22754   auto res = isl_set_get_simple_fixed_box_hull(get());
22755   if (!res)
22756     exception::throw_last_error(saved_ctx);
22757   return manage(res);
22758 }
22759 
get_simple_fixed_box_hull()22760 isl::fixed_box set::get_simple_fixed_box_hull() const
22761 {
22762   return simple_fixed_box_hull();
22763 }
22764 
space()22765 isl::space set::space() 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_set_get_space(get());
22772   if (!res)
22773     exception::throw_last_error(saved_ctx);
22774   return manage(res);
22775 }
22776 
get_space()22777 isl::space set::get_space() const
22778 {
22779   return space();
22780 }
22781 
stride(int pos)22782 isl::val set::stride(int pos) 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_set_get_stride(get(), pos);
22789   if (!res)
22790     exception::throw_last_error(saved_ctx);
22791   return manage(res);
22792 }
22793 
get_stride(int pos)22794 isl::val set::get_stride(int pos) const
22795 {
22796   return stride(pos);
22797 }
22798 
subtract(isl::set set2)22799 isl::set set::subtract(isl::set set2) const
22800 {
22801   if (!ptr || set2.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_set_subtract(copy(), set2.release());
22806   if (!res)
22807     exception::throw_last_error(saved_ctx);
22808   return manage(res);
22809 }
22810 
subtract(const isl::union_set & uset2)22811 isl::union_set set::subtract(const isl::union_set &uset2) const
22812 {
22813   if (!ptr)
22814     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22815   return isl::union_set(*this).subtract(uset2);
22816 }
22817 
subtract(const isl::basic_set & set2)22818 isl::set set::subtract(const isl::basic_set &set2) const
22819 {
22820   if (!ptr)
22821     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22822   return this->subtract(isl::set(set2));
22823 }
22824 
subtract(const isl::point & set2)22825 isl::set set::subtract(const isl::point &set2) const
22826 {
22827   if (!ptr)
22828     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22829   return this->subtract(isl::set(set2));
22830 }
22831 
to_list()22832 isl::set_list set::to_list() const
22833 {
22834   if (!ptr)
22835     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22836   auto saved_ctx = ctx();
22837   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22838   auto res = isl_set_to_list(copy());
22839   if (!res)
22840     exception::throw_last_error(saved_ctx);
22841   return manage(res);
22842 }
22843 
to_union_set()22844 isl::union_set set::to_union_set() const
22845 {
22846   if (!ptr)
22847     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22848   auto saved_ctx = ctx();
22849   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22850   auto res = isl_set_to_union_set(copy());
22851   if (!res)
22852     exception::throw_last_error(saved_ctx);
22853   return manage(res);
22854 }
22855 
translation()22856 isl::map set::translation() const
22857 {
22858   if (!ptr)
22859     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22860   auto saved_ctx = ctx();
22861   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22862   auto res = isl_set_translation(copy());
22863   if (!res)
22864     exception::throw_last_error(saved_ctx);
22865   return manage(res);
22866 }
22867 
tuple_dim()22868 unsigned set::tuple_dim() const
22869 {
22870   if (!ptr)
22871     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22872   auto saved_ctx = ctx();
22873   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22874   auto res = isl_set_tuple_dim(get());
22875   if (res < 0)
22876     exception::throw_last_error(saved_ctx);
22877   return res;
22878 }
22879 
unbind_params(isl::multi_id tuple)22880 isl::set set::unbind_params(isl::multi_id tuple) const
22881 {
22882   if (!ptr || tuple.is_null())
22883     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22884   auto saved_ctx = ctx();
22885   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22886   auto res = isl_set_unbind_params(copy(), tuple.release());
22887   if (!res)
22888     exception::throw_last_error(saved_ctx);
22889   return manage(res);
22890 }
22891 
unbind_params_insert_domain(isl::multi_id domain)22892 isl::map set::unbind_params_insert_domain(isl::multi_id domain) const
22893 {
22894   if (!ptr || domain.is_null())
22895     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22896   auto saved_ctx = ctx();
22897   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22898   auto res = isl_set_unbind_params_insert_domain(copy(), domain.release());
22899   if (!res)
22900     exception::throw_last_error(saved_ctx);
22901   return manage(res);
22902 }
22903 
unite(isl::set set2)22904 isl::set set::unite(isl::set set2) const
22905 {
22906   if (!ptr || set2.is_null())
22907     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22908   auto saved_ctx = ctx();
22909   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22910   auto res = isl_set_union(copy(), set2.release());
22911   if (!res)
22912     exception::throw_last_error(saved_ctx);
22913   return manage(res);
22914 }
22915 
unite(const isl::union_set & uset2)22916 isl::union_set set::unite(const isl::union_set &uset2) const
22917 {
22918   if (!ptr)
22919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22920   return isl::union_set(*this).unite(uset2);
22921 }
22922 
unite(const isl::basic_set & set2)22923 isl::set set::unite(const isl::basic_set &set2) const
22924 {
22925   if (!ptr)
22926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22927   return this->unite(isl::set(set2));
22928 }
22929 
unite(const isl::point & set2)22930 isl::set set::unite(const isl::point &set2) const
22931 {
22932   if (!ptr)
22933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22934   return this->unite(isl::set(set2));
22935 }
22936 
universe(isl::space space)22937 isl::set set::universe(isl::space space)
22938 {
22939   if (space.is_null())
22940     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22941   auto saved_ctx = space.ctx();
22942   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22943   auto res = isl_set_universe(space.release());
22944   if (!res)
22945     exception::throw_last_error(saved_ctx);
22946   return manage(res);
22947 }
22948 
unshifted_simple_hull()22949 isl::basic_set set::unshifted_simple_hull() const
22950 {
22951   if (!ptr)
22952     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22953   auto saved_ctx = ctx();
22954   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22955   auto res = isl_set_unshifted_simple_hull(copy());
22956   if (!res)
22957     exception::throw_last_error(saved_ctx);
22958   return manage(res);
22959 }
22960 
unwrap()22961 isl::map set::unwrap() const
22962 {
22963   if (!ptr)
22964     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22965   auto saved_ctx = ctx();
22966   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22967   auto res = isl_set_unwrap(copy());
22968   if (!res)
22969     exception::throw_last_error(saved_ctx);
22970   return manage(res);
22971 }
22972 
upper_bound(isl::multi_pw_aff upper)22973 isl::set set::upper_bound(isl::multi_pw_aff upper) const
22974 {
22975   if (!ptr || upper.is_null())
22976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22977   auto saved_ctx = ctx();
22978   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22979   auto res = isl_set_upper_bound_multi_pw_aff(copy(), upper.release());
22980   if (!res)
22981     exception::throw_last_error(saved_ctx);
22982   return manage(res);
22983 }
22984 
upper_bound(isl::multi_val upper)22985 isl::set set::upper_bound(isl::multi_val upper) const
22986 {
22987   if (!ptr || upper.is_null())
22988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22989   auto saved_ctx = ctx();
22990   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22991   auto res = isl_set_upper_bound_multi_val(copy(), upper.release());
22992   if (!res)
22993     exception::throw_last_error(saved_ctx);
22994   return manage(res);
22995 }
22996 
22997 inline std::ostream &operator<<(std::ostream &os, const set &obj)
22998 {
22999   if (!obj.get())
23000     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23001   auto saved_ctx = isl_set_get_ctx(obj.get());
23002   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23003   char *str = isl_set_to_str(obj.get());
23004   if (!str)
23005     exception::throw_last_error(saved_ctx);
23006   os << str;
23007   free(str);
23008   return os;
23009 }
23010 
23011 // implementations for isl::set_list
manage(__isl_take isl_set_list * ptr)23012 set_list manage(__isl_take isl_set_list *ptr) {
23013   if (!ptr)
23014     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23015   return set_list(ptr);
23016 }
manage_copy(__isl_keep isl_set_list * ptr)23017 set_list manage_copy(__isl_keep isl_set_list *ptr) {
23018   if (!ptr)
23019     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23020   auto saved_ctx = isl_set_list_get_ctx(ptr);
23021   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23022   ptr = isl_set_list_copy(ptr);
23023   if (!ptr)
23024     exception::throw_last_error(saved_ctx);
23025   return set_list(ptr);
23026 }
23027 
set_list()23028 set_list::set_list()
23029     : ptr(nullptr) {}
23030 
set_list(const set_list & obj)23031 set_list::set_list(const set_list &obj)
23032     : ptr(nullptr)
23033 {
23034   if (!obj.ptr)
23035     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23036   auto saved_ctx = isl_set_list_get_ctx(obj.ptr);
23037   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23038   ptr = obj.copy();
23039   if (!ptr)
23040     exception::throw_last_error(saved_ctx);
23041 }
23042 
set_list(__isl_take isl_set_list * ptr)23043 set_list::set_list(__isl_take isl_set_list *ptr)
23044     : ptr(ptr) {}
23045 
set_list(isl::ctx ctx,int n)23046 set_list::set_list(isl::ctx ctx, int n)
23047 {
23048   auto saved_ctx = ctx;
23049   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23050   auto res = isl_set_list_alloc(ctx.release(), n);
23051   if (!res)
23052     exception::throw_last_error(saved_ctx);
23053   ptr = res;
23054 }
23055 
set_list(isl::set el)23056 set_list::set_list(isl::set el)
23057 {
23058   if (el.is_null())
23059     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23060   auto saved_ctx = el.ctx();
23061   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23062   auto res = isl_set_list_from_set(el.release());
23063   if (!res)
23064     exception::throw_last_error(saved_ctx);
23065   ptr = res;
23066 }
23067 
set_list(isl::ctx ctx,const std::string & str)23068 set_list::set_list(isl::ctx ctx, const std::string &str)
23069 {
23070   auto saved_ctx = ctx;
23071   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23072   auto res = isl_set_list_read_from_str(ctx.release(), str.c_str());
23073   if (!res)
23074     exception::throw_last_error(saved_ctx);
23075   ptr = res;
23076 }
23077 
23078 set_list &set_list::operator=(set_list obj) {
23079   std::swap(this->ptr, obj.ptr);
23080   return *this;
23081 }
23082 
~set_list()23083 set_list::~set_list() {
23084   if (ptr)
23085     isl_set_list_free(ptr);
23086 }
23087 
copy()23088 __isl_give isl_set_list *set_list::copy() const & {
23089   return isl_set_list_copy(ptr);
23090 }
23091 
get()23092 __isl_keep isl_set_list *set_list::get() const {
23093   return ptr;
23094 }
23095 
release()23096 __isl_give isl_set_list *set_list::release() {
23097   isl_set_list *tmp = ptr;
23098   ptr = nullptr;
23099   return tmp;
23100 }
23101 
is_null()23102 bool set_list::is_null() const {
23103   return ptr == nullptr;
23104 }
23105 
ctx()23106 isl::ctx set_list::ctx() const {
23107   return isl::ctx(isl_set_list_get_ctx(ptr));
23108 }
23109 
add(isl::set el)23110 isl::set_list set_list::add(isl::set el) const
23111 {
23112   if (!ptr || el.is_null())
23113     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23114   auto saved_ctx = ctx();
23115   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23116   auto res = isl_set_list_add(copy(), el.release());
23117   if (!res)
23118     exception::throw_last_error(saved_ctx);
23119   return manage(res);
23120 }
23121 
at(int index)23122 isl::set set_list::at(int index) const
23123 {
23124   if (!ptr)
23125     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23126   auto saved_ctx = ctx();
23127   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23128   auto res = isl_set_list_get_at(get(), index);
23129   if (!res)
23130     exception::throw_last_error(saved_ctx);
23131   return manage(res);
23132 }
23133 
get_at(int index)23134 isl::set set_list::get_at(int index) const
23135 {
23136   return at(index);
23137 }
23138 
clear()23139 isl::set_list set_list::clear() 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_set_list_clear(copy());
23146   if (!res)
23147     exception::throw_last_error(saved_ctx);
23148   return manage(res);
23149 }
23150 
concat(isl::set_list list2)23151 isl::set_list set_list::concat(isl::set_list list2) const
23152 {
23153   if (!ptr || list2.is_null())
23154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23155   auto saved_ctx = ctx();
23156   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23157   auto res = isl_set_list_concat(copy(), list2.release());
23158   if (!res)
23159     exception::throw_last_error(saved_ctx);
23160   return manage(res);
23161 }
23162 
drop(unsigned int first,unsigned int n)23163 isl::set_list set_list::drop(unsigned int first, unsigned int n) const
23164 {
23165   if (!ptr)
23166     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23167   auto saved_ctx = ctx();
23168   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23169   auto res = isl_set_list_drop(copy(), first, n);
23170   if (!res)
23171     exception::throw_last_error(saved_ctx);
23172   return manage(res);
23173 }
23174 
foreach(const std::function<void (isl::set)> & fn)23175 void set_list::foreach(const std::function<void(isl::set)> &fn) const
23176 {
23177   if (!ptr)
23178     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23179   auto saved_ctx = ctx();
23180   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23181   struct fn_data {
23182     std::function<void(isl::set)> func;
23183     std::exception_ptr eptr;
23184   } fn_data = { fn };
23185   auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
23186     auto *data = static_cast<struct fn_data *>(arg_1);
23187     ISL_CPP_TRY {
23188       (data->func)(manage(arg_0));
23189       return isl_stat_ok;
23190     } ISL_CPP_CATCH_ALL {
23191       data->eptr = std::current_exception();
23192       return isl_stat_error;
23193     }
23194   };
23195   auto res = isl_set_list_foreach(get(), fn_lambda, &fn_data);
23196   if (fn_data.eptr)
23197     std::rethrow_exception(fn_data.eptr);
23198   if (res < 0)
23199     exception::throw_last_error(saved_ctx);
23200   return;
23201 }
23202 
insert(unsigned int pos,isl::set el)23203 isl::set_list set_list::insert(unsigned int pos, isl::set el) const
23204 {
23205   if (!ptr || el.is_null())
23206     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23207   auto saved_ctx = ctx();
23208   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23209   auto res = isl_set_list_insert(copy(), pos, el.release());
23210   if (!res)
23211     exception::throw_last_error(saved_ctx);
23212   return manage(res);
23213 }
23214 
size()23215 unsigned set_list::size() const
23216 {
23217   if (!ptr)
23218     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23219   auto saved_ctx = ctx();
23220   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23221   auto res = isl_set_list_size(get());
23222   if (res < 0)
23223     exception::throw_last_error(saved_ctx);
23224   return res;
23225 }
23226 
23227 inline std::ostream &operator<<(std::ostream &os, const set_list &obj)
23228 {
23229   if (!obj.get())
23230     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23231   auto saved_ctx = isl_set_list_get_ctx(obj.get());
23232   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23233   char *str = isl_set_list_to_str(obj.get());
23234   if (!str)
23235     exception::throw_last_error(saved_ctx);
23236   os << str;
23237   free(str);
23238   return os;
23239 }
23240 
23241 // implementations for isl::space
manage(__isl_take isl_space * ptr)23242 space manage(__isl_take isl_space *ptr) {
23243   if (!ptr)
23244     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23245   return space(ptr);
23246 }
manage_copy(__isl_keep isl_space * ptr)23247 space manage_copy(__isl_keep isl_space *ptr) {
23248   if (!ptr)
23249     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23250   auto saved_ctx = isl_space_get_ctx(ptr);
23251   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23252   ptr = isl_space_copy(ptr);
23253   if (!ptr)
23254     exception::throw_last_error(saved_ctx);
23255   return space(ptr);
23256 }
23257 
space()23258 space::space()
23259     : ptr(nullptr) {}
23260 
space(const space & obj)23261 space::space(const space &obj)
23262     : ptr(nullptr)
23263 {
23264   if (!obj.ptr)
23265     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23266   auto saved_ctx = isl_space_get_ctx(obj.ptr);
23267   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23268   ptr = obj.copy();
23269   if (!ptr)
23270     exception::throw_last_error(saved_ctx);
23271 }
23272 
space(__isl_take isl_space * ptr)23273 space::space(__isl_take isl_space *ptr)
23274     : ptr(ptr) {}
23275 
23276 space &space::operator=(space obj) {
23277   std::swap(this->ptr, obj.ptr);
23278   return *this;
23279 }
23280 
~space()23281 space::~space() {
23282   if (ptr)
23283     isl_space_free(ptr);
23284 }
23285 
copy()23286 __isl_give isl_space *space::copy() const & {
23287   return isl_space_copy(ptr);
23288 }
23289 
get()23290 __isl_keep isl_space *space::get() const {
23291   return ptr;
23292 }
23293 
release()23294 __isl_give isl_space *space::release() {
23295   isl_space *tmp = ptr;
23296   ptr = nullptr;
23297   return tmp;
23298 }
23299 
is_null()23300 bool space::is_null() const {
23301   return ptr == nullptr;
23302 }
23303 
ctx()23304 isl::ctx space::ctx() const {
23305   return isl::ctx(isl_space_get_ctx(ptr));
23306 }
23307 
add_named_tuple(isl::id tuple_id,unsigned int dim)23308 isl::space space::add_named_tuple(isl::id tuple_id, unsigned int dim) const
23309 {
23310   if (!ptr || tuple_id.is_null())
23311     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23312   auto saved_ctx = ctx();
23313   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23314   auto res = isl_space_add_named_tuple_id_ui(copy(), tuple_id.release(), dim);
23315   if (!res)
23316     exception::throw_last_error(saved_ctx);
23317   return manage(res);
23318 }
23319 
add_named_tuple(const std::string & tuple_id,unsigned int dim)23320 isl::space space::add_named_tuple(const std::string &tuple_id, unsigned int dim) const
23321 {
23322   if (!ptr)
23323     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23324   return this->add_named_tuple(isl::id(ctx(), tuple_id), dim);
23325 }
23326 
add_param(isl::id id)23327 isl::space space::add_param(isl::id id) const
23328 {
23329   if (!ptr || id.is_null())
23330     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23331   auto saved_ctx = ctx();
23332   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23333   auto res = isl_space_add_param_id(copy(), id.release());
23334   if (!res)
23335     exception::throw_last_error(saved_ctx);
23336   return manage(res);
23337 }
23338 
add_param(const std::string & id)23339 isl::space space::add_param(const std::string &id) const
23340 {
23341   if (!ptr)
23342     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23343   return this->add_param(isl::id(ctx(), id));
23344 }
23345 
add_unnamed_tuple(unsigned int dim)23346 isl::space space::add_unnamed_tuple(unsigned int dim) const
23347 {
23348   if (!ptr)
23349     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23350   auto saved_ctx = ctx();
23351   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23352   auto res = isl_space_add_unnamed_tuple_ui(copy(), dim);
23353   if (!res)
23354     exception::throw_last_error(saved_ctx);
23355   return manage(res);
23356 }
23357 
curry()23358 isl::space space::curry() const
23359 {
23360   if (!ptr)
23361     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23362   auto saved_ctx = ctx();
23363   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23364   auto res = isl_space_curry(copy());
23365   if (!res)
23366     exception::throw_last_error(saved_ctx);
23367   return manage(res);
23368 }
23369 
domain()23370 isl::space space::domain() const
23371 {
23372   if (!ptr)
23373     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23374   auto saved_ctx = ctx();
23375   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23376   auto res = isl_space_domain(copy());
23377   if (!res)
23378     exception::throw_last_error(saved_ctx);
23379   return manage(res);
23380 }
23381 
domain_map_multi_aff()23382 isl::multi_aff space::domain_map_multi_aff() const
23383 {
23384   if (!ptr)
23385     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23386   auto saved_ctx = ctx();
23387   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23388   auto res = isl_space_domain_map_multi_aff(copy());
23389   if (!res)
23390     exception::throw_last_error(saved_ctx);
23391   return manage(res);
23392 }
23393 
domain_map_pw_multi_aff()23394 isl::pw_multi_aff space::domain_map_pw_multi_aff() const
23395 {
23396   if (!ptr)
23397     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23398   auto saved_ctx = ctx();
23399   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23400   auto res = isl_space_domain_map_pw_multi_aff(copy());
23401   if (!res)
23402     exception::throw_last_error(saved_ctx);
23403   return manage(res);
23404 }
23405 
domain_tuple_id()23406 isl::id space::domain_tuple_id() const
23407 {
23408   if (!ptr)
23409     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23410   auto saved_ctx = ctx();
23411   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23412   auto res = isl_space_get_domain_tuple_id(get());
23413   if (!res)
23414     exception::throw_last_error(saved_ctx);
23415   return manage(res);
23416 }
23417 
get_domain_tuple_id()23418 isl::id space::get_domain_tuple_id() const
23419 {
23420   return domain_tuple_id();
23421 }
23422 
flatten_domain()23423 isl::space space::flatten_domain() const
23424 {
23425   if (!ptr)
23426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23427   auto saved_ctx = ctx();
23428   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23429   auto res = isl_space_flatten_domain(copy());
23430   if (!res)
23431     exception::throw_last_error(saved_ctx);
23432   return manage(res);
23433 }
23434 
flatten_range()23435 isl::space space::flatten_range() const
23436 {
23437   if (!ptr)
23438     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23439   auto saved_ctx = ctx();
23440   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23441   auto res = isl_space_flatten_range(copy());
23442   if (!res)
23443     exception::throw_last_error(saved_ctx);
23444   return manage(res);
23445 }
23446 
has_domain_tuple_id()23447 bool space::has_domain_tuple_id() const
23448 {
23449   if (!ptr)
23450     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23451   auto saved_ctx = ctx();
23452   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23453   auto res = isl_space_has_domain_tuple_id(get());
23454   if (res < 0)
23455     exception::throw_last_error(saved_ctx);
23456   return res;
23457 }
23458 
has_range_tuple_id()23459 bool space::has_range_tuple_id() const
23460 {
23461   if (!ptr)
23462     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23463   auto saved_ctx = ctx();
23464   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23465   auto res = isl_space_has_range_tuple_id(get());
23466   if (res < 0)
23467     exception::throw_last_error(saved_ctx);
23468   return res;
23469 }
23470 
identity_multi_aff_on_domain()23471 isl::multi_aff space::identity_multi_aff_on_domain() const
23472 {
23473   if (!ptr)
23474     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23475   auto saved_ctx = ctx();
23476   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23477   auto res = isl_space_identity_multi_aff_on_domain(copy());
23478   if (!res)
23479     exception::throw_last_error(saved_ctx);
23480   return manage(res);
23481 }
23482 
identity_multi_pw_aff_on_domain()23483 isl::multi_pw_aff space::identity_multi_pw_aff_on_domain() const
23484 {
23485   if (!ptr)
23486     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23487   auto saved_ctx = ctx();
23488   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23489   auto res = isl_space_identity_multi_pw_aff_on_domain(copy());
23490   if (!res)
23491     exception::throw_last_error(saved_ctx);
23492   return manage(res);
23493 }
23494 
identity_pw_multi_aff_on_domain()23495 isl::pw_multi_aff space::identity_pw_multi_aff_on_domain() const
23496 {
23497   if (!ptr)
23498     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23499   auto saved_ctx = ctx();
23500   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23501   auto res = isl_space_identity_pw_multi_aff_on_domain(copy());
23502   if (!res)
23503     exception::throw_last_error(saved_ctx);
23504   return manage(res);
23505 }
23506 
is_equal(const isl::space & space2)23507 bool space::is_equal(const isl::space &space2) const
23508 {
23509   if (!ptr || space2.is_null())
23510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23511   auto saved_ctx = ctx();
23512   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23513   auto res = isl_space_is_equal(get(), space2.get());
23514   if (res < 0)
23515     exception::throw_last_error(saved_ctx);
23516   return res;
23517 }
23518 
is_wrapping()23519 bool space::is_wrapping() const
23520 {
23521   if (!ptr)
23522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23523   auto saved_ctx = ctx();
23524   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23525   auto res = isl_space_is_wrapping(get());
23526   if (res < 0)
23527     exception::throw_last_error(saved_ctx);
23528   return res;
23529 }
23530 
map_from_set()23531 isl::space space::map_from_set() const
23532 {
23533   if (!ptr)
23534     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23535   auto saved_ctx = ctx();
23536   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23537   auto res = isl_space_map_from_set(copy());
23538   if (!res)
23539     exception::throw_last_error(saved_ctx);
23540   return manage(res);
23541 }
23542 
multi_aff(isl::aff_list list)23543 isl::multi_aff space::multi_aff(isl::aff_list list) const
23544 {
23545   if (!ptr || list.is_null())
23546     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23547   auto saved_ctx = ctx();
23548   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23549   auto res = isl_space_multi_aff(copy(), list.release());
23550   if (!res)
23551     exception::throw_last_error(saved_ctx);
23552   return manage(res);
23553 }
23554 
multi_aff_on_domain(isl::multi_val mv)23555 isl::multi_aff space::multi_aff_on_domain(isl::multi_val mv) const
23556 {
23557   if (!ptr || mv.is_null())
23558     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23559   auto saved_ctx = ctx();
23560   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23561   auto res = isl_space_multi_aff_on_domain_multi_val(copy(), mv.release());
23562   if (!res)
23563     exception::throw_last_error(saved_ctx);
23564   return manage(res);
23565 }
23566 
multi_id(isl::id_list list)23567 isl::multi_id space::multi_id(isl::id_list list) const
23568 {
23569   if (!ptr || list.is_null())
23570     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23571   auto saved_ctx = ctx();
23572   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23573   auto res = isl_space_multi_id(copy(), list.release());
23574   if (!res)
23575     exception::throw_last_error(saved_ctx);
23576   return manage(res);
23577 }
23578 
multi_pw_aff(isl::pw_aff_list list)23579 isl::multi_pw_aff space::multi_pw_aff(isl::pw_aff_list list) const
23580 {
23581   if (!ptr || list.is_null())
23582     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23583   auto saved_ctx = ctx();
23584   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23585   auto res = isl_space_multi_pw_aff(copy(), list.release());
23586   if (!res)
23587     exception::throw_last_error(saved_ctx);
23588   return manage(res);
23589 }
23590 
multi_union_pw_aff(isl::union_pw_aff_list list)23591 isl::multi_union_pw_aff space::multi_union_pw_aff(isl::union_pw_aff_list list) const
23592 {
23593   if (!ptr || list.is_null())
23594     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23595   auto saved_ctx = ctx();
23596   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23597   auto res = isl_space_multi_union_pw_aff(copy(), list.release());
23598   if (!res)
23599     exception::throw_last_error(saved_ctx);
23600   return manage(res);
23601 }
23602 
multi_val(isl::val_list list)23603 isl::multi_val space::multi_val(isl::val_list list) const
23604 {
23605   if (!ptr || list.is_null())
23606     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23607   auto saved_ctx = ctx();
23608   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23609   auto res = isl_space_multi_val(copy(), list.release());
23610   if (!res)
23611     exception::throw_last_error(saved_ctx);
23612   return manage(res);
23613 }
23614 
param_aff_on_domain(isl::id id)23615 isl::aff space::param_aff_on_domain(isl::id id) const
23616 {
23617   if (!ptr || id.is_null())
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_space_param_aff_on_domain_id(copy(), id.release());
23622   if (!res)
23623     exception::throw_last_error(saved_ctx);
23624   return manage(res);
23625 }
23626 
param_aff_on_domain(const std::string & id)23627 isl::aff space::param_aff_on_domain(const std::string &id) const
23628 {
23629   if (!ptr)
23630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23631   return this->param_aff_on_domain(isl::id(ctx(), id));
23632 }
23633 
params()23634 isl::space space::params() const
23635 {
23636   if (!ptr)
23637     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23638   auto saved_ctx = ctx();
23639   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23640   auto res = isl_space_params(copy());
23641   if (!res)
23642     exception::throw_last_error(saved_ctx);
23643   return manage(res);
23644 }
23645 
product(isl::space right)23646 isl::space space::product(isl::space right) const
23647 {
23648   if (!ptr || right.is_null())
23649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23650   auto saved_ctx = ctx();
23651   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23652   auto res = isl_space_product(copy(), right.release());
23653   if (!res)
23654     exception::throw_last_error(saved_ctx);
23655   return manage(res);
23656 }
23657 
range()23658 isl::space space::range() const
23659 {
23660   if (!ptr)
23661     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23662   auto saved_ctx = ctx();
23663   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23664   auto res = isl_space_range(copy());
23665   if (!res)
23666     exception::throw_last_error(saved_ctx);
23667   return manage(res);
23668 }
23669 
range_map_multi_aff()23670 isl::multi_aff space::range_map_multi_aff() const
23671 {
23672   if (!ptr)
23673     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23674   auto saved_ctx = ctx();
23675   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23676   auto res = isl_space_range_map_multi_aff(copy());
23677   if (!res)
23678     exception::throw_last_error(saved_ctx);
23679   return manage(res);
23680 }
23681 
range_map_pw_multi_aff()23682 isl::pw_multi_aff space::range_map_pw_multi_aff() const
23683 {
23684   if (!ptr)
23685     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23686   auto saved_ctx = ctx();
23687   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23688   auto res = isl_space_range_map_pw_multi_aff(copy());
23689   if (!res)
23690     exception::throw_last_error(saved_ctx);
23691   return manage(res);
23692 }
23693 
range_reverse()23694 isl::space space::range_reverse() const
23695 {
23696   if (!ptr)
23697     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23698   auto saved_ctx = ctx();
23699   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23700   auto res = isl_space_range_reverse(copy());
23701   if (!res)
23702     exception::throw_last_error(saved_ctx);
23703   return manage(res);
23704 }
23705 
range_tuple_id()23706 isl::id space::range_tuple_id() const
23707 {
23708   if (!ptr)
23709     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23710   auto saved_ctx = ctx();
23711   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23712   auto res = isl_space_get_range_tuple_id(get());
23713   if (!res)
23714     exception::throw_last_error(saved_ctx);
23715   return manage(res);
23716 }
23717 
get_range_tuple_id()23718 isl::id space::get_range_tuple_id() const
23719 {
23720   return range_tuple_id();
23721 }
23722 
reverse()23723 isl::space space::reverse() const
23724 {
23725   if (!ptr)
23726     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23727   auto saved_ctx = ctx();
23728   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23729   auto res = isl_space_reverse(copy());
23730   if (!res)
23731     exception::throw_last_error(saved_ctx);
23732   return manage(res);
23733 }
23734 
set_domain_tuple(isl::id id)23735 isl::space space::set_domain_tuple(isl::id id) const
23736 {
23737   if (!ptr || id.is_null())
23738     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23739   auto saved_ctx = ctx();
23740   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23741   auto res = isl_space_set_domain_tuple_id(copy(), id.release());
23742   if (!res)
23743     exception::throw_last_error(saved_ctx);
23744   return manage(res);
23745 }
23746 
set_domain_tuple(const std::string & id)23747 isl::space space::set_domain_tuple(const std::string &id) const
23748 {
23749   if (!ptr)
23750     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23751   return this->set_domain_tuple(isl::id(ctx(), id));
23752 }
23753 
set_range_tuple(isl::id id)23754 isl::space space::set_range_tuple(isl::id id) const
23755 {
23756   if (!ptr || id.is_null())
23757     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23758   auto saved_ctx = ctx();
23759   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23760   auto res = isl_space_set_range_tuple_id(copy(), id.release());
23761   if (!res)
23762     exception::throw_last_error(saved_ctx);
23763   return manage(res);
23764 }
23765 
set_range_tuple(const std::string & id)23766 isl::space space::set_range_tuple(const std::string &id) const
23767 {
23768   if (!ptr)
23769     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23770   return this->set_range_tuple(isl::id(ctx(), id));
23771 }
23772 
uncurry()23773 isl::space space::uncurry() const
23774 {
23775   if (!ptr)
23776     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23777   auto saved_ctx = ctx();
23778   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23779   auto res = isl_space_uncurry(copy());
23780   if (!res)
23781     exception::throw_last_error(saved_ctx);
23782   return manage(res);
23783 }
23784 
unit(isl::ctx ctx)23785 isl::space space::unit(isl::ctx ctx)
23786 {
23787   auto saved_ctx = ctx;
23788   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23789   auto res = isl_space_unit(ctx.release());
23790   if (!res)
23791     exception::throw_last_error(saved_ctx);
23792   return manage(res);
23793 }
23794 
universe_map()23795 isl::map space::universe_map() const
23796 {
23797   if (!ptr)
23798     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23799   auto saved_ctx = ctx();
23800   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23801   auto res = isl_space_universe_map(copy());
23802   if (!res)
23803     exception::throw_last_error(saved_ctx);
23804   return manage(res);
23805 }
23806 
universe_set()23807 isl::set space::universe_set() const
23808 {
23809   if (!ptr)
23810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23811   auto saved_ctx = ctx();
23812   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23813   auto res = isl_space_universe_set(copy());
23814   if (!res)
23815     exception::throw_last_error(saved_ctx);
23816   return manage(res);
23817 }
23818 
unwrap()23819 isl::space space::unwrap() const
23820 {
23821   if (!ptr)
23822     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23823   auto saved_ctx = ctx();
23824   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23825   auto res = isl_space_unwrap(copy());
23826   if (!res)
23827     exception::throw_last_error(saved_ctx);
23828   return manage(res);
23829 }
23830 
wrap()23831 isl::space space::wrap() const
23832 {
23833   if (!ptr)
23834     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23835   auto saved_ctx = ctx();
23836   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23837   auto res = isl_space_wrap(copy());
23838   if (!res)
23839     exception::throw_last_error(saved_ctx);
23840   return manage(res);
23841 }
23842 
zero_aff_on_domain()23843 isl::aff space::zero_aff_on_domain() const
23844 {
23845   if (!ptr)
23846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23847   auto saved_ctx = ctx();
23848   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23849   auto res = isl_space_zero_aff_on_domain(copy());
23850   if (!res)
23851     exception::throw_last_error(saved_ctx);
23852   return manage(res);
23853 }
23854 
zero_multi_aff()23855 isl::multi_aff space::zero_multi_aff() const
23856 {
23857   if (!ptr)
23858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23859   auto saved_ctx = ctx();
23860   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23861   auto res = isl_space_zero_multi_aff(copy());
23862   if (!res)
23863     exception::throw_last_error(saved_ctx);
23864   return manage(res);
23865 }
23866 
zero_multi_pw_aff()23867 isl::multi_pw_aff space::zero_multi_pw_aff() const
23868 {
23869   if (!ptr)
23870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23871   auto saved_ctx = ctx();
23872   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23873   auto res = isl_space_zero_multi_pw_aff(copy());
23874   if (!res)
23875     exception::throw_last_error(saved_ctx);
23876   return manage(res);
23877 }
23878 
zero_multi_union_pw_aff()23879 isl::multi_union_pw_aff space::zero_multi_union_pw_aff() const
23880 {
23881   if (!ptr)
23882     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23883   auto saved_ctx = ctx();
23884   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23885   auto res = isl_space_zero_multi_union_pw_aff(copy());
23886   if (!res)
23887     exception::throw_last_error(saved_ctx);
23888   return manage(res);
23889 }
23890 
zero_multi_val()23891 isl::multi_val space::zero_multi_val() const
23892 {
23893   if (!ptr)
23894     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23895   auto saved_ctx = ctx();
23896   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23897   auto res = isl_space_zero_multi_val(copy());
23898   if (!res)
23899     exception::throw_last_error(saved_ctx);
23900   return manage(res);
23901 }
23902 
23903 inline std::ostream &operator<<(std::ostream &os, const space &obj)
23904 {
23905   if (!obj.get())
23906     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23907   auto saved_ctx = isl_space_get_ctx(obj.get());
23908   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23909   char *str = isl_space_to_str(obj.get());
23910   if (!str)
23911     exception::throw_last_error(saved_ctx);
23912   os << str;
23913   free(str);
23914   return os;
23915 }
23916 
23917 // implementations for isl::union_access_info
manage(__isl_take isl_union_access_info * ptr)23918 union_access_info manage(__isl_take isl_union_access_info *ptr) {
23919   if (!ptr)
23920     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23921   return union_access_info(ptr);
23922 }
manage_copy(__isl_keep isl_union_access_info * ptr)23923 union_access_info manage_copy(__isl_keep isl_union_access_info *ptr) {
23924   if (!ptr)
23925     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23926   auto saved_ctx = isl_union_access_info_get_ctx(ptr);
23927   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23928   ptr = isl_union_access_info_copy(ptr);
23929   if (!ptr)
23930     exception::throw_last_error(saved_ctx);
23931   return union_access_info(ptr);
23932 }
23933 
union_access_info()23934 union_access_info::union_access_info()
23935     : ptr(nullptr) {}
23936 
union_access_info(const union_access_info & obj)23937 union_access_info::union_access_info(const union_access_info &obj)
23938     : ptr(nullptr)
23939 {
23940   if (!obj.ptr)
23941     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23942   auto saved_ctx = isl_union_access_info_get_ctx(obj.ptr);
23943   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23944   ptr = obj.copy();
23945   if (!ptr)
23946     exception::throw_last_error(saved_ctx);
23947 }
23948 
union_access_info(__isl_take isl_union_access_info * ptr)23949 union_access_info::union_access_info(__isl_take isl_union_access_info *ptr)
23950     : ptr(ptr) {}
23951 
union_access_info(isl::union_map sink)23952 union_access_info::union_access_info(isl::union_map sink)
23953 {
23954   if (sink.is_null())
23955     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23956   auto saved_ctx = sink.ctx();
23957   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23958   auto res = isl_union_access_info_from_sink(sink.release());
23959   if (!res)
23960     exception::throw_last_error(saved_ctx);
23961   ptr = res;
23962 }
23963 
23964 union_access_info &union_access_info::operator=(union_access_info obj) {
23965   std::swap(this->ptr, obj.ptr);
23966   return *this;
23967 }
23968 
~union_access_info()23969 union_access_info::~union_access_info() {
23970   if (ptr)
23971     isl_union_access_info_free(ptr);
23972 }
23973 
copy()23974 __isl_give isl_union_access_info *union_access_info::copy() const & {
23975   return isl_union_access_info_copy(ptr);
23976 }
23977 
get()23978 __isl_keep isl_union_access_info *union_access_info::get() const {
23979   return ptr;
23980 }
23981 
release()23982 __isl_give isl_union_access_info *union_access_info::release() {
23983   isl_union_access_info *tmp = ptr;
23984   ptr = nullptr;
23985   return tmp;
23986 }
23987 
is_null()23988 bool union_access_info::is_null() const {
23989   return ptr == nullptr;
23990 }
23991 
ctx()23992 isl::ctx union_access_info::ctx() const {
23993   return isl::ctx(isl_union_access_info_get_ctx(ptr));
23994 }
23995 
compute_flow()23996 isl::union_flow union_access_info::compute_flow() const
23997 {
23998   if (!ptr)
23999     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24000   auto saved_ctx = ctx();
24001   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24002   auto res = isl_union_access_info_compute_flow(copy());
24003   if (!res)
24004     exception::throw_last_error(saved_ctx);
24005   return manage(res);
24006 }
24007 
set_kill(isl::union_map kill)24008 isl::union_access_info union_access_info::set_kill(isl::union_map kill) const
24009 {
24010   if (!ptr || kill.is_null())
24011     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24012   auto saved_ctx = ctx();
24013   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24014   auto res = isl_union_access_info_set_kill(copy(), kill.release());
24015   if (!res)
24016     exception::throw_last_error(saved_ctx);
24017   return manage(res);
24018 }
24019 
set_may_source(isl::union_map may_source)24020 isl::union_access_info union_access_info::set_may_source(isl::union_map may_source) const
24021 {
24022   if (!ptr || may_source.is_null())
24023     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24024   auto saved_ctx = ctx();
24025   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24026   auto res = isl_union_access_info_set_may_source(copy(), may_source.release());
24027   if (!res)
24028     exception::throw_last_error(saved_ctx);
24029   return manage(res);
24030 }
24031 
set_must_source(isl::union_map must_source)24032 isl::union_access_info union_access_info::set_must_source(isl::union_map must_source) const
24033 {
24034   if (!ptr || must_source.is_null())
24035     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24036   auto saved_ctx = ctx();
24037   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24038   auto res = isl_union_access_info_set_must_source(copy(), must_source.release());
24039   if (!res)
24040     exception::throw_last_error(saved_ctx);
24041   return manage(res);
24042 }
24043 
set_schedule(isl::schedule schedule)24044 isl::union_access_info union_access_info::set_schedule(isl::schedule schedule) const
24045 {
24046   if (!ptr || schedule.is_null())
24047     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24048   auto saved_ctx = ctx();
24049   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24050   auto res = isl_union_access_info_set_schedule(copy(), schedule.release());
24051   if (!res)
24052     exception::throw_last_error(saved_ctx);
24053   return manage(res);
24054 }
24055 
set_schedule_map(isl::union_map schedule_map)24056 isl::union_access_info union_access_info::set_schedule_map(isl::union_map schedule_map) const
24057 {
24058   if (!ptr || schedule_map.is_null())
24059     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24060   auto saved_ctx = ctx();
24061   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24062   auto res = isl_union_access_info_set_schedule_map(copy(), schedule_map.release());
24063   if (!res)
24064     exception::throw_last_error(saved_ctx);
24065   return manage(res);
24066 }
24067 
24068 inline std::ostream &operator<<(std::ostream &os, const union_access_info &obj)
24069 {
24070   if (!obj.get())
24071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24072   auto saved_ctx = isl_union_access_info_get_ctx(obj.get());
24073   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24074   char *str = isl_union_access_info_to_str(obj.get());
24075   if (!str)
24076     exception::throw_last_error(saved_ctx);
24077   os << str;
24078   free(str);
24079   return os;
24080 }
24081 
24082 // implementations for isl::union_flow
manage(__isl_take isl_union_flow * ptr)24083 union_flow manage(__isl_take isl_union_flow *ptr) {
24084   if (!ptr)
24085     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24086   return union_flow(ptr);
24087 }
manage_copy(__isl_keep isl_union_flow * ptr)24088 union_flow manage_copy(__isl_keep isl_union_flow *ptr) {
24089   if (!ptr)
24090     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24091   auto saved_ctx = isl_union_flow_get_ctx(ptr);
24092   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24093   ptr = isl_union_flow_copy(ptr);
24094   if (!ptr)
24095     exception::throw_last_error(saved_ctx);
24096   return union_flow(ptr);
24097 }
24098 
union_flow()24099 union_flow::union_flow()
24100     : ptr(nullptr) {}
24101 
union_flow(const union_flow & obj)24102 union_flow::union_flow(const union_flow &obj)
24103     : ptr(nullptr)
24104 {
24105   if (!obj.ptr)
24106     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24107   auto saved_ctx = isl_union_flow_get_ctx(obj.ptr);
24108   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24109   ptr = obj.copy();
24110   if (!ptr)
24111     exception::throw_last_error(saved_ctx);
24112 }
24113 
union_flow(__isl_take isl_union_flow * ptr)24114 union_flow::union_flow(__isl_take isl_union_flow *ptr)
24115     : ptr(ptr) {}
24116 
24117 union_flow &union_flow::operator=(union_flow obj) {
24118   std::swap(this->ptr, obj.ptr);
24119   return *this;
24120 }
24121 
~union_flow()24122 union_flow::~union_flow() {
24123   if (ptr)
24124     isl_union_flow_free(ptr);
24125 }
24126 
copy()24127 __isl_give isl_union_flow *union_flow::copy() const & {
24128   return isl_union_flow_copy(ptr);
24129 }
24130 
get()24131 __isl_keep isl_union_flow *union_flow::get() const {
24132   return ptr;
24133 }
24134 
release()24135 __isl_give isl_union_flow *union_flow::release() {
24136   isl_union_flow *tmp = ptr;
24137   ptr = nullptr;
24138   return tmp;
24139 }
24140 
is_null()24141 bool union_flow::is_null() const {
24142   return ptr == nullptr;
24143 }
24144 
ctx()24145 isl::ctx union_flow::ctx() const {
24146   return isl::ctx(isl_union_flow_get_ctx(ptr));
24147 }
24148 
full_may_dependence()24149 isl::union_map union_flow::full_may_dependence() const
24150 {
24151   if (!ptr)
24152     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24153   auto saved_ctx = ctx();
24154   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24155   auto res = isl_union_flow_get_full_may_dependence(get());
24156   if (!res)
24157     exception::throw_last_error(saved_ctx);
24158   return manage(res);
24159 }
24160 
get_full_may_dependence()24161 isl::union_map union_flow::get_full_may_dependence() const
24162 {
24163   return full_may_dependence();
24164 }
24165 
full_must_dependence()24166 isl::union_map union_flow::full_must_dependence() 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_union_flow_get_full_must_dependence(get());
24173   if (!res)
24174     exception::throw_last_error(saved_ctx);
24175   return manage(res);
24176 }
24177 
get_full_must_dependence()24178 isl::union_map union_flow::get_full_must_dependence() const
24179 {
24180   return full_must_dependence();
24181 }
24182 
may_dependence()24183 isl::union_map union_flow::may_dependence() const
24184 {
24185   if (!ptr)
24186     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24187   auto saved_ctx = ctx();
24188   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24189   auto res = isl_union_flow_get_may_dependence(get());
24190   if (!res)
24191     exception::throw_last_error(saved_ctx);
24192   return manage(res);
24193 }
24194 
get_may_dependence()24195 isl::union_map union_flow::get_may_dependence() const
24196 {
24197   return may_dependence();
24198 }
24199 
may_no_source()24200 isl::union_map union_flow::may_no_source() const
24201 {
24202   if (!ptr)
24203     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24204   auto saved_ctx = ctx();
24205   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24206   auto res = isl_union_flow_get_may_no_source(get());
24207   if (!res)
24208     exception::throw_last_error(saved_ctx);
24209   return manage(res);
24210 }
24211 
get_may_no_source()24212 isl::union_map union_flow::get_may_no_source() const
24213 {
24214   return may_no_source();
24215 }
24216 
must_dependence()24217 isl::union_map union_flow::must_dependence() const
24218 {
24219   if (!ptr)
24220     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24221   auto saved_ctx = ctx();
24222   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24223   auto res = isl_union_flow_get_must_dependence(get());
24224   if (!res)
24225     exception::throw_last_error(saved_ctx);
24226   return manage(res);
24227 }
24228 
get_must_dependence()24229 isl::union_map union_flow::get_must_dependence() const
24230 {
24231   return must_dependence();
24232 }
24233 
must_no_source()24234 isl::union_map union_flow::must_no_source() const
24235 {
24236   if (!ptr)
24237     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24238   auto saved_ctx = ctx();
24239   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24240   auto res = isl_union_flow_get_must_no_source(get());
24241   if (!res)
24242     exception::throw_last_error(saved_ctx);
24243   return manage(res);
24244 }
24245 
get_must_no_source()24246 isl::union_map union_flow::get_must_no_source() const
24247 {
24248   return must_no_source();
24249 }
24250 
24251 inline std::ostream &operator<<(std::ostream &os, const union_flow &obj)
24252 {
24253   if (!obj.get())
24254     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24255   auto saved_ctx = isl_union_flow_get_ctx(obj.get());
24256   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24257   char *str = isl_union_flow_to_str(obj.get());
24258   if (!str)
24259     exception::throw_last_error(saved_ctx);
24260   os << str;
24261   free(str);
24262   return os;
24263 }
24264 
24265 // implementations for isl::union_map
manage(__isl_take isl_union_map * ptr)24266 union_map manage(__isl_take isl_union_map *ptr) {
24267   if (!ptr)
24268     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24269   return union_map(ptr);
24270 }
manage_copy(__isl_keep isl_union_map * ptr)24271 union_map manage_copy(__isl_keep isl_union_map *ptr) {
24272   if (!ptr)
24273     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24274   auto saved_ctx = isl_union_map_get_ctx(ptr);
24275   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24276   ptr = isl_union_map_copy(ptr);
24277   if (!ptr)
24278     exception::throw_last_error(saved_ctx);
24279   return union_map(ptr);
24280 }
24281 
union_map()24282 union_map::union_map()
24283     : ptr(nullptr) {}
24284 
union_map(const union_map & obj)24285 union_map::union_map(const union_map &obj)
24286     : ptr(nullptr)
24287 {
24288   if (!obj.ptr)
24289     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24290   auto saved_ctx = isl_union_map_get_ctx(obj.ptr);
24291   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24292   ptr = obj.copy();
24293   if (!ptr)
24294     exception::throw_last_error(saved_ctx);
24295 }
24296 
union_map(__isl_take isl_union_map * ptr)24297 union_map::union_map(__isl_take isl_union_map *ptr)
24298     : ptr(ptr) {}
24299 
union_map(isl::basic_map bmap)24300 union_map::union_map(isl::basic_map bmap)
24301 {
24302   if (bmap.is_null())
24303     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24304   auto saved_ctx = bmap.ctx();
24305   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24306   auto res = isl_union_map_from_basic_map(bmap.release());
24307   if (!res)
24308     exception::throw_last_error(saved_ctx);
24309   ptr = res;
24310 }
24311 
union_map(isl::map map)24312 union_map::union_map(isl::map map)
24313 {
24314   if (map.is_null())
24315     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24316   auto saved_ctx = map.ctx();
24317   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24318   auto res = isl_union_map_from_map(map.release());
24319   if (!res)
24320     exception::throw_last_error(saved_ctx);
24321   ptr = res;
24322 }
24323 
union_map(isl::ctx ctx,const std::string & str)24324 union_map::union_map(isl::ctx ctx, const std::string &str)
24325 {
24326   auto saved_ctx = ctx;
24327   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24328   auto res = isl_union_map_read_from_str(ctx.release(), str.c_str());
24329   if (!res)
24330     exception::throw_last_error(saved_ctx);
24331   ptr = res;
24332 }
24333 
24334 union_map &union_map::operator=(union_map obj) {
24335   std::swap(this->ptr, obj.ptr);
24336   return *this;
24337 }
24338 
~union_map()24339 union_map::~union_map() {
24340   if (ptr)
24341     isl_union_map_free(ptr);
24342 }
24343 
copy()24344 __isl_give isl_union_map *union_map::copy() const & {
24345   return isl_union_map_copy(ptr);
24346 }
24347 
get()24348 __isl_keep isl_union_map *union_map::get() const {
24349   return ptr;
24350 }
24351 
release()24352 __isl_give isl_union_map *union_map::release() {
24353   isl_union_map *tmp = ptr;
24354   ptr = nullptr;
24355   return tmp;
24356 }
24357 
is_null()24358 bool union_map::is_null() const {
24359   return ptr == nullptr;
24360 }
24361 
ctx()24362 isl::ctx union_map::ctx() const {
24363   return isl::ctx(isl_union_map_get_ctx(ptr));
24364 }
24365 
affine_hull()24366 isl::union_map union_map::affine_hull() const
24367 {
24368   if (!ptr)
24369     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24370   auto saved_ctx = ctx();
24371   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24372   auto res = isl_union_map_affine_hull(copy());
24373   if (!res)
24374     exception::throw_last_error(saved_ctx);
24375   return manage(res);
24376 }
24377 
apply_domain(isl::union_map umap2)24378 isl::union_map union_map::apply_domain(isl::union_map umap2) const
24379 {
24380   if (!ptr || umap2.is_null())
24381     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24382   auto saved_ctx = ctx();
24383   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24384   auto res = isl_union_map_apply_domain(copy(), umap2.release());
24385   if (!res)
24386     exception::throw_last_error(saved_ctx);
24387   return manage(res);
24388 }
24389 
apply_range(isl::union_map umap2)24390 isl::union_map union_map::apply_range(isl::union_map umap2) const
24391 {
24392   if (!ptr || umap2.is_null())
24393     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24394   auto saved_ctx = ctx();
24395   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24396   auto res = isl_union_map_apply_range(copy(), umap2.release());
24397   if (!res)
24398     exception::throw_last_error(saved_ctx);
24399   return manage(res);
24400 }
24401 
as_map()24402 isl::map union_map::as_map() const
24403 {
24404   if (!ptr)
24405     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24406   auto saved_ctx = ctx();
24407   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24408   auto res = isl_union_map_as_map(copy());
24409   if (!res)
24410     exception::throw_last_error(saved_ctx);
24411   return manage(res);
24412 }
24413 
as_multi_union_pw_aff()24414 isl::multi_union_pw_aff union_map::as_multi_union_pw_aff() const
24415 {
24416   if (!ptr)
24417     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24418   auto saved_ctx = ctx();
24419   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24420   auto res = isl_union_map_as_multi_union_pw_aff(copy());
24421   if (!res)
24422     exception::throw_last_error(saved_ctx);
24423   return manage(res);
24424 }
24425 
as_union_pw_multi_aff()24426 isl::union_pw_multi_aff union_map::as_union_pw_multi_aff() const
24427 {
24428   if (!ptr)
24429     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24430   auto saved_ctx = ctx();
24431   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24432   auto res = isl_union_map_as_union_pw_multi_aff(copy());
24433   if (!res)
24434     exception::throw_last_error(saved_ctx);
24435   return manage(res);
24436 }
24437 
bind_range(isl::multi_id tuple)24438 isl::union_set union_map::bind_range(isl::multi_id tuple) const
24439 {
24440   if (!ptr || tuple.is_null())
24441     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24442   auto saved_ctx = ctx();
24443   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24444   auto res = isl_union_map_bind_range(copy(), tuple.release());
24445   if (!res)
24446     exception::throw_last_error(saved_ctx);
24447   return manage(res);
24448 }
24449 
coalesce()24450 isl::union_map union_map::coalesce() const
24451 {
24452   if (!ptr)
24453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24454   auto saved_ctx = ctx();
24455   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24456   auto res = isl_union_map_coalesce(copy());
24457   if (!res)
24458     exception::throw_last_error(saved_ctx);
24459   return manage(res);
24460 }
24461 
compute_divs()24462 isl::union_map union_map::compute_divs() const
24463 {
24464   if (!ptr)
24465     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24466   auto saved_ctx = ctx();
24467   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24468   auto res = isl_union_map_compute_divs(copy());
24469   if (!res)
24470     exception::throw_last_error(saved_ctx);
24471   return manage(res);
24472 }
24473 
curry()24474 isl::union_map union_map::curry() const
24475 {
24476   if (!ptr)
24477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24478   auto saved_ctx = ctx();
24479   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24480   auto res = isl_union_map_curry(copy());
24481   if (!res)
24482     exception::throw_last_error(saved_ctx);
24483   return manage(res);
24484 }
24485 
deltas()24486 isl::union_set union_map::deltas() const
24487 {
24488   if (!ptr)
24489     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24490   auto saved_ctx = ctx();
24491   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24492   auto res = isl_union_map_deltas(copy());
24493   if (!res)
24494     exception::throw_last_error(saved_ctx);
24495   return manage(res);
24496 }
24497 
detect_equalities()24498 isl::union_map union_map::detect_equalities() const
24499 {
24500   if (!ptr)
24501     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24502   auto saved_ctx = ctx();
24503   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24504   auto res = isl_union_map_detect_equalities(copy());
24505   if (!res)
24506     exception::throw_last_error(saved_ctx);
24507   return manage(res);
24508 }
24509 
domain()24510 isl::union_set union_map::domain() const
24511 {
24512   if (!ptr)
24513     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24514   auto saved_ctx = ctx();
24515   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24516   auto res = isl_union_map_domain(copy());
24517   if (!res)
24518     exception::throw_last_error(saved_ctx);
24519   return manage(res);
24520 }
24521 
domain_factor_domain()24522 isl::union_map union_map::domain_factor_domain() const
24523 {
24524   if (!ptr)
24525     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24526   auto saved_ctx = ctx();
24527   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24528   auto res = isl_union_map_domain_factor_domain(copy());
24529   if (!res)
24530     exception::throw_last_error(saved_ctx);
24531   return manage(res);
24532 }
24533 
domain_factor_range()24534 isl::union_map union_map::domain_factor_range() const
24535 {
24536   if (!ptr)
24537     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24538   auto saved_ctx = ctx();
24539   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24540   auto res = isl_union_map_domain_factor_range(copy());
24541   if (!res)
24542     exception::throw_last_error(saved_ctx);
24543   return manage(res);
24544 }
24545 
domain_map()24546 isl::union_map union_map::domain_map() const
24547 {
24548   if (!ptr)
24549     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24550   auto saved_ctx = ctx();
24551   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24552   auto res = isl_union_map_domain_map(copy());
24553   if (!res)
24554     exception::throw_last_error(saved_ctx);
24555   return manage(res);
24556 }
24557 
domain_map_union_pw_multi_aff()24558 isl::union_pw_multi_aff union_map::domain_map_union_pw_multi_aff() const
24559 {
24560   if (!ptr)
24561     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24562   auto saved_ctx = ctx();
24563   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24564   auto res = isl_union_map_domain_map_union_pw_multi_aff(copy());
24565   if (!res)
24566     exception::throw_last_error(saved_ctx);
24567   return manage(res);
24568 }
24569 
domain_product(isl::union_map umap2)24570 isl::union_map union_map::domain_product(isl::union_map umap2) const
24571 {
24572   if (!ptr || umap2.is_null())
24573     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24574   auto saved_ctx = ctx();
24575   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24576   auto res = isl_union_map_domain_product(copy(), umap2.release());
24577   if (!res)
24578     exception::throw_last_error(saved_ctx);
24579   return manage(res);
24580 }
24581 
empty(isl::ctx ctx)24582 isl::union_map union_map::empty(isl::ctx ctx)
24583 {
24584   auto saved_ctx = ctx;
24585   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24586   auto res = isl_union_map_empty_ctx(ctx.release());
24587   if (!res)
24588     exception::throw_last_error(saved_ctx);
24589   return manage(res);
24590 }
24591 
eq_at(isl::multi_union_pw_aff mupa)24592 isl::union_map union_map::eq_at(isl::multi_union_pw_aff mupa) const
24593 {
24594   if (!ptr || mupa.is_null())
24595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24596   auto saved_ctx = ctx();
24597   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24598   auto res = isl_union_map_eq_at_multi_union_pw_aff(copy(), mupa.release());
24599   if (!res)
24600     exception::throw_last_error(saved_ctx);
24601   return manage(res);
24602 }
24603 
every_map(const std::function<bool (isl::map)> & test)24604 bool union_map::every_map(const std::function<bool(isl::map)> &test) const
24605 {
24606   if (!ptr)
24607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24608   auto saved_ctx = ctx();
24609   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24610   struct test_data {
24611     std::function<bool(isl::map)> func;
24612     std::exception_ptr eptr;
24613   } test_data = { test };
24614   auto test_lambda = [](isl_map *arg_0, void *arg_1) -> isl_bool {
24615     auto *data = static_cast<struct test_data *>(arg_1);
24616     ISL_CPP_TRY {
24617       auto ret = (data->func)(manage_copy(arg_0));
24618       return ret ? isl_bool_true : isl_bool_false;
24619     } ISL_CPP_CATCH_ALL {
24620       data->eptr = std::current_exception();
24621       return isl_bool_error;
24622     }
24623   };
24624   auto res = isl_union_map_every_map(get(), test_lambda, &test_data);
24625   if (test_data.eptr)
24626     std::rethrow_exception(test_data.eptr);
24627   if (res < 0)
24628     exception::throw_last_error(saved_ctx);
24629   return res;
24630 }
24631 
extract_map(isl::space space)24632 isl::map union_map::extract_map(isl::space space) const
24633 {
24634   if (!ptr || space.is_null())
24635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24636   auto saved_ctx = ctx();
24637   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24638   auto res = isl_union_map_extract_map(get(), space.release());
24639   if (!res)
24640     exception::throw_last_error(saved_ctx);
24641   return manage(res);
24642 }
24643 
factor_domain()24644 isl::union_map union_map::factor_domain() const
24645 {
24646   if (!ptr)
24647     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24648   auto saved_ctx = ctx();
24649   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24650   auto res = isl_union_map_factor_domain(copy());
24651   if (!res)
24652     exception::throw_last_error(saved_ctx);
24653   return manage(res);
24654 }
24655 
factor_range()24656 isl::union_map union_map::factor_range() const
24657 {
24658   if (!ptr)
24659     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24660   auto saved_ctx = ctx();
24661   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24662   auto res = isl_union_map_factor_range(copy());
24663   if (!res)
24664     exception::throw_last_error(saved_ctx);
24665   return manage(res);
24666 }
24667 
fixed_power(isl::val exp)24668 isl::union_map union_map::fixed_power(isl::val exp) const
24669 {
24670   if (!ptr || exp.is_null())
24671     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24672   auto saved_ctx = ctx();
24673   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24674   auto res = isl_union_map_fixed_power_val(copy(), exp.release());
24675   if (!res)
24676     exception::throw_last_error(saved_ctx);
24677   return manage(res);
24678 }
24679 
fixed_power(long exp)24680 isl::union_map union_map::fixed_power(long exp) const
24681 {
24682   if (!ptr)
24683     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24684   return this->fixed_power(isl::val(ctx(), exp));
24685 }
24686 
foreach_map(const std::function<void (isl::map)> & fn)24687 void union_map::foreach_map(const std::function<void(isl::map)> &fn) const
24688 {
24689   if (!ptr)
24690     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24691   auto saved_ctx = ctx();
24692   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24693   struct fn_data {
24694     std::function<void(isl::map)> func;
24695     std::exception_ptr eptr;
24696   } fn_data = { fn };
24697   auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
24698     auto *data = static_cast<struct fn_data *>(arg_1);
24699     ISL_CPP_TRY {
24700       (data->func)(manage(arg_0));
24701       return isl_stat_ok;
24702     } ISL_CPP_CATCH_ALL {
24703       data->eptr = std::current_exception();
24704       return isl_stat_error;
24705     }
24706   };
24707   auto res = isl_union_map_foreach_map(get(), fn_lambda, &fn_data);
24708   if (fn_data.eptr)
24709     std::rethrow_exception(fn_data.eptr);
24710   if (res < 0)
24711     exception::throw_last_error(saved_ctx);
24712   return;
24713 }
24714 
from(isl::multi_union_pw_aff mupa)24715 isl::union_map union_map::from(isl::multi_union_pw_aff mupa)
24716 {
24717   if (mupa.is_null())
24718     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24719   auto saved_ctx = mupa.ctx();
24720   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24721   auto res = isl_union_map_from_multi_union_pw_aff(mupa.release());
24722   if (!res)
24723     exception::throw_last_error(saved_ctx);
24724   return manage(res);
24725 }
24726 
from(isl::union_pw_multi_aff upma)24727 isl::union_map union_map::from(isl::union_pw_multi_aff upma)
24728 {
24729   if (upma.is_null())
24730     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24731   auto saved_ctx = upma.ctx();
24732   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24733   auto res = isl_union_map_from_union_pw_multi_aff(upma.release());
24734   if (!res)
24735     exception::throw_last_error(saved_ctx);
24736   return manage(res);
24737 }
24738 
from_domain(isl::union_set uset)24739 isl::union_map union_map::from_domain(isl::union_set uset)
24740 {
24741   if (uset.is_null())
24742     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24743   auto saved_ctx = uset.ctx();
24744   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24745   auto res = isl_union_map_from_domain(uset.release());
24746   if (!res)
24747     exception::throw_last_error(saved_ctx);
24748   return manage(res);
24749 }
24750 
from_domain_and_range(isl::union_set domain,isl::union_set range)24751 isl::union_map union_map::from_domain_and_range(isl::union_set domain, isl::union_set range)
24752 {
24753   if (domain.is_null() || range.is_null())
24754     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24755   auto saved_ctx = domain.ctx();
24756   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24757   auto res = isl_union_map_from_domain_and_range(domain.release(), range.release());
24758   if (!res)
24759     exception::throw_last_error(saved_ctx);
24760   return manage(res);
24761 }
24762 
from_range(isl::union_set uset)24763 isl::union_map union_map::from_range(isl::union_set uset)
24764 {
24765   if (uset.is_null())
24766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24767   auto saved_ctx = uset.ctx();
24768   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24769   auto res = isl_union_map_from_range(uset.release());
24770   if (!res)
24771     exception::throw_last_error(saved_ctx);
24772   return manage(res);
24773 }
24774 
gist(isl::union_map context)24775 isl::union_map union_map::gist(isl::union_map context) const
24776 {
24777   if (!ptr || context.is_null())
24778     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24779   auto saved_ctx = ctx();
24780   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24781   auto res = isl_union_map_gist(copy(), context.release());
24782   if (!res)
24783     exception::throw_last_error(saved_ctx);
24784   return manage(res);
24785 }
24786 
gist_domain(isl::union_set uset)24787 isl::union_map union_map::gist_domain(isl::union_set uset) const
24788 {
24789   if (!ptr || uset.is_null())
24790     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24791   auto saved_ctx = ctx();
24792   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24793   auto res = isl_union_map_gist_domain(copy(), uset.release());
24794   if (!res)
24795     exception::throw_last_error(saved_ctx);
24796   return manage(res);
24797 }
24798 
gist_params(isl::set set)24799 isl::union_map union_map::gist_params(isl::set set) const
24800 {
24801   if (!ptr || set.is_null())
24802     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24803   auto saved_ctx = ctx();
24804   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24805   auto res = isl_union_map_gist_params(copy(), set.release());
24806   if (!res)
24807     exception::throw_last_error(saved_ctx);
24808   return manage(res);
24809 }
24810 
gist_range(isl::union_set uset)24811 isl::union_map union_map::gist_range(isl::union_set uset) const
24812 {
24813   if (!ptr || uset.is_null())
24814     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24815   auto saved_ctx = ctx();
24816   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24817   auto res = isl_union_map_gist_range(copy(), uset.release());
24818   if (!res)
24819     exception::throw_last_error(saved_ctx);
24820   return manage(res);
24821 }
24822 
intersect(isl::union_map umap2)24823 isl::union_map union_map::intersect(isl::union_map umap2) const
24824 {
24825   if (!ptr || umap2.is_null())
24826     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24827   auto saved_ctx = ctx();
24828   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24829   auto res = isl_union_map_intersect(copy(), umap2.release());
24830   if (!res)
24831     exception::throw_last_error(saved_ctx);
24832   return manage(res);
24833 }
24834 
intersect_domain(isl::space space)24835 isl::union_map union_map::intersect_domain(isl::space space) const
24836 {
24837   if (!ptr || space.is_null())
24838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24839   auto saved_ctx = ctx();
24840   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24841   auto res = isl_union_map_intersect_domain_space(copy(), space.release());
24842   if (!res)
24843     exception::throw_last_error(saved_ctx);
24844   return manage(res);
24845 }
24846 
intersect_domain(isl::union_set uset)24847 isl::union_map union_map::intersect_domain(isl::union_set uset) const
24848 {
24849   if (!ptr || uset.is_null())
24850     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24851   auto saved_ctx = ctx();
24852   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24853   auto res = isl_union_map_intersect_domain_union_set(copy(), uset.release());
24854   if (!res)
24855     exception::throw_last_error(saved_ctx);
24856   return manage(res);
24857 }
24858 
intersect_domain_factor_domain(isl::union_map factor)24859 isl::union_map union_map::intersect_domain_factor_domain(isl::union_map factor) const
24860 {
24861   if (!ptr || factor.is_null())
24862     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24863   auto saved_ctx = ctx();
24864   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24865   auto res = isl_union_map_intersect_domain_factor_domain(copy(), factor.release());
24866   if (!res)
24867     exception::throw_last_error(saved_ctx);
24868   return manage(res);
24869 }
24870 
intersect_domain_factor_range(isl::union_map factor)24871 isl::union_map union_map::intersect_domain_factor_range(isl::union_map factor) const
24872 {
24873   if (!ptr || factor.is_null())
24874     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24875   auto saved_ctx = ctx();
24876   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24877   auto res = isl_union_map_intersect_domain_factor_range(copy(), factor.release());
24878   if (!res)
24879     exception::throw_last_error(saved_ctx);
24880   return manage(res);
24881 }
24882 
intersect_params(isl::set set)24883 isl::union_map union_map::intersect_params(isl::set set) const
24884 {
24885   if (!ptr || set.is_null())
24886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24887   auto saved_ctx = ctx();
24888   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24889   auto res = isl_union_map_intersect_params(copy(), set.release());
24890   if (!res)
24891     exception::throw_last_error(saved_ctx);
24892   return manage(res);
24893 }
24894 
intersect_range(isl::space space)24895 isl::union_map union_map::intersect_range(isl::space space) const
24896 {
24897   if (!ptr || space.is_null())
24898     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24899   auto saved_ctx = ctx();
24900   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24901   auto res = isl_union_map_intersect_range_space(copy(), space.release());
24902   if (!res)
24903     exception::throw_last_error(saved_ctx);
24904   return manage(res);
24905 }
24906 
intersect_range(isl::union_set uset)24907 isl::union_map union_map::intersect_range(isl::union_set uset) const
24908 {
24909   if (!ptr || uset.is_null())
24910     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24911   auto saved_ctx = ctx();
24912   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24913   auto res = isl_union_map_intersect_range_union_set(copy(), uset.release());
24914   if (!res)
24915     exception::throw_last_error(saved_ctx);
24916   return manage(res);
24917 }
24918 
intersect_range_factor_domain(isl::union_map factor)24919 isl::union_map union_map::intersect_range_factor_domain(isl::union_map factor) const
24920 {
24921   if (!ptr || factor.is_null())
24922     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24923   auto saved_ctx = ctx();
24924   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24925   auto res = isl_union_map_intersect_range_factor_domain(copy(), factor.release());
24926   if (!res)
24927     exception::throw_last_error(saved_ctx);
24928   return manage(res);
24929 }
24930 
intersect_range_factor_range(isl::union_map factor)24931 isl::union_map union_map::intersect_range_factor_range(isl::union_map factor) const
24932 {
24933   if (!ptr || factor.is_null())
24934     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24935   auto saved_ctx = ctx();
24936   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24937   auto res = isl_union_map_intersect_range_factor_range(copy(), factor.release());
24938   if (!res)
24939     exception::throw_last_error(saved_ctx);
24940   return manage(res);
24941 }
24942 
is_bijective()24943 bool union_map::is_bijective() const
24944 {
24945   if (!ptr)
24946     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24947   auto saved_ctx = ctx();
24948   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24949   auto res = isl_union_map_is_bijective(get());
24950   if (res < 0)
24951     exception::throw_last_error(saved_ctx);
24952   return res;
24953 }
24954 
is_disjoint(const isl::union_map & umap2)24955 bool union_map::is_disjoint(const isl::union_map &umap2) const
24956 {
24957   if (!ptr || umap2.is_null())
24958     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24959   auto saved_ctx = ctx();
24960   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24961   auto res = isl_union_map_is_disjoint(get(), umap2.get());
24962   if (res < 0)
24963     exception::throw_last_error(saved_ctx);
24964   return res;
24965 }
24966 
is_empty()24967 bool union_map::is_empty() const
24968 {
24969   if (!ptr)
24970     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24971   auto saved_ctx = ctx();
24972   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24973   auto res = isl_union_map_is_empty(get());
24974   if (res < 0)
24975     exception::throw_last_error(saved_ctx);
24976   return res;
24977 }
24978 
is_equal(const isl::union_map & umap2)24979 bool union_map::is_equal(const isl::union_map &umap2) const
24980 {
24981   if (!ptr || umap2.is_null())
24982     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24983   auto saved_ctx = ctx();
24984   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24985   auto res = isl_union_map_is_equal(get(), umap2.get());
24986   if (res < 0)
24987     exception::throw_last_error(saved_ctx);
24988   return res;
24989 }
24990 
is_injective()24991 bool union_map::is_injective() const
24992 {
24993   if (!ptr)
24994     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24995   auto saved_ctx = ctx();
24996   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24997   auto res = isl_union_map_is_injective(get());
24998   if (res < 0)
24999     exception::throw_last_error(saved_ctx);
25000   return res;
25001 }
25002 
is_single_valued()25003 bool union_map::is_single_valued() const
25004 {
25005   if (!ptr)
25006     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25007   auto saved_ctx = ctx();
25008   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25009   auto res = isl_union_map_is_single_valued(get());
25010   if (res < 0)
25011     exception::throw_last_error(saved_ctx);
25012   return res;
25013 }
25014 
is_strict_subset(const isl::union_map & umap2)25015 bool union_map::is_strict_subset(const isl::union_map &umap2) const
25016 {
25017   if (!ptr || umap2.is_null())
25018     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25019   auto saved_ctx = ctx();
25020   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25021   auto res = isl_union_map_is_strict_subset(get(), umap2.get());
25022   if (res < 0)
25023     exception::throw_last_error(saved_ctx);
25024   return res;
25025 }
25026 
is_subset(const isl::union_map & umap2)25027 bool union_map::is_subset(const isl::union_map &umap2) const
25028 {
25029   if (!ptr || umap2.is_null())
25030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25031   auto saved_ctx = ctx();
25032   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25033   auto res = isl_union_map_is_subset(get(), umap2.get());
25034   if (res < 0)
25035     exception::throw_last_error(saved_ctx);
25036   return res;
25037 }
25038 
isa_map()25039 bool union_map::isa_map() const
25040 {
25041   if (!ptr)
25042     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25043   auto saved_ctx = ctx();
25044   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25045   auto res = isl_union_map_isa_map(get());
25046   if (res < 0)
25047     exception::throw_last_error(saved_ctx);
25048   return res;
25049 }
25050 
lexmax()25051 isl::union_map union_map::lexmax() const
25052 {
25053   if (!ptr)
25054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25055   auto saved_ctx = ctx();
25056   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25057   auto res = isl_union_map_lexmax(copy());
25058   if (!res)
25059     exception::throw_last_error(saved_ctx);
25060   return manage(res);
25061 }
25062 
lexmin()25063 isl::union_map union_map::lexmin() const
25064 {
25065   if (!ptr)
25066     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25067   auto saved_ctx = ctx();
25068   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25069   auto res = isl_union_map_lexmin(copy());
25070   if (!res)
25071     exception::throw_last_error(saved_ctx);
25072   return manage(res);
25073 }
25074 
map_list()25075 isl::map_list union_map::map_list() const
25076 {
25077   if (!ptr)
25078     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25079   auto saved_ctx = ctx();
25080   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25081   auto res = isl_union_map_get_map_list(get());
25082   if (!res)
25083     exception::throw_last_error(saved_ctx);
25084   return manage(res);
25085 }
25086 
get_map_list()25087 isl::map_list union_map::get_map_list() const
25088 {
25089   return map_list();
25090 }
25091 
polyhedral_hull()25092 isl::union_map union_map::polyhedral_hull() const
25093 {
25094   if (!ptr)
25095     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25096   auto saved_ctx = ctx();
25097   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25098   auto res = isl_union_map_polyhedral_hull(copy());
25099   if (!res)
25100     exception::throw_last_error(saved_ctx);
25101   return manage(res);
25102 }
25103 
preimage_domain(isl::multi_aff ma)25104 isl::union_map union_map::preimage_domain(isl::multi_aff ma) const
25105 {
25106   if (!ptr || ma.is_null())
25107     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25108   auto saved_ctx = ctx();
25109   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25110   auto res = isl_union_map_preimage_domain_multi_aff(copy(), ma.release());
25111   if (!res)
25112     exception::throw_last_error(saved_ctx);
25113   return manage(res);
25114 }
25115 
preimage_domain(isl::multi_pw_aff mpa)25116 isl::union_map union_map::preimage_domain(isl::multi_pw_aff mpa) const
25117 {
25118   if (!ptr || mpa.is_null())
25119     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25120   auto saved_ctx = ctx();
25121   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25122   auto res = isl_union_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
25123   if (!res)
25124     exception::throw_last_error(saved_ctx);
25125   return manage(res);
25126 }
25127 
preimage_domain(isl::pw_multi_aff pma)25128 isl::union_map union_map::preimage_domain(isl::pw_multi_aff pma) const
25129 {
25130   if (!ptr || pma.is_null())
25131     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25132   auto saved_ctx = ctx();
25133   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25134   auto res = isl_union_map_preimage_domain_pw_multi_aff(copy(), pma.release());
25135   if (!res)
25136     exception::throw_last_error(saved_ctx);
25137   return manage(res);
25138 }
25139 
preimage_domain(isl::union_pw_multi_aff upma)25140 isl::union_map union_map::preimage_domain(isl::union_pw_multi_aff upma) const
25141 {
25142   if (!ptr || upma.is_null())
25143     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25144   auto saved_ctx = ctx();
25145   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25146   auto res = isl_union_map_preimage_domain_union_pw_multi_aff(copy(), upma.release());
25147   if (!res)
25148     exception::throw_last_error(saved_ctx);
25149   return manage(res);
25150 }
25151 
preimage_range(isl::multi_aff ma)25152 isl::union_map union_map::preimage_range(isl::multi_aff ma) const
25153 {
25154   if (!ptr || ma.is_null())
25155     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25156   auto saved_ctx = ctx();
25157   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25158   auto res = isl_union_map_preimage_range_multi_aff(copy(), ma.release());
25159   if (!res)
25160     exception::throw_last_error(saved_ctx);
25161   return manage(res);
25162 }
25163 
preimage_range(isl::pw_multi_aff pma)25164 isl::union_map union_map::preimage_range(isl::pw_multi_aff pma) const
25165 {
25166   if (!ptr || pma.is_null())
25167     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25168   auto saved_ctx = ctx();
25169   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25170   auto res = isl_union_map_preimage_range_pw_multi_aff(copy(), pma.release());
25171   if (!res)
25172     exception::throw_last_error(saved_ctx);
25173   return manage(res);
25174 }
25175 
preimage_range(isl::union_pw_multi_aff upma)25176 isl::union_map union_map::preimage_range(isl::union_pw_multi_aff upma) const
25177 {
25178   if (!ptr || upma.is_null())
25179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25180   auto saved_ctx = ctx();
25181   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25182   auto res = isl_union_map_preimage_range_union_pw_multi_aff(copy(), upma.release());
25183   if (!res)
25184     exception::throw_last_error(saved_ctx);
25185   return manage(res);
25186 }
25187 
product(isl::union_map umap2)25188 isl::union_map union_map::product(isl::union_map umap2) const
25189 {
25190   if (!ptr || umap2.is_null())
25191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25192   auto saved_ctx = ctx();
25193   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25194   auto res = isl_union_map_product(copy(), umap2.release());
25195   if (!res)
25196     exception::throw_last_error(saved_ctx);
25197   return manage(res);
25198 }
25199 
project_out_all_params()25200 isl::union_map union_map::project_out_all_params() const
25201 {
25202   if (!ptr)
25203     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25204   auto saved_ctx = ctx();
25205   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25206   auto res = isl_union_map_project_out_all_params(copy());
25207   if (!res)
25208     exception::throw_last_error(saved_ctx);
25209   return manage(res);
25210 }
25211 
range()25212 isl::union_set union_map::range() const
25213 {
25214   if (!ptr)
25215     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25216   auto saved_ctx = ctx();
25217   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25218   auto res = isl_union_map_range(copy());
25219   if (!res)
25220     exception::throw_last_error(saved_ctx);
25221   return manage(res);
25222 }
25223 
range_factor_domain()25224 isl::union_map union_map::range_factor_domain() const
25225 {
25226   if (!ptr)
25227     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25228   auto saved_ctx = ctx();
25229   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25230   auto res = isl_union_map_range_factor_domain(copy());
25231   if (!res)
25232     exception::throw_last_error(saved_ctx);
25233   return manage(res);
25234 }
25235 
range_factor_range()25236 isl::union_map union_map::range_factor_range() const
25237 {
25238   if (!ptr)
25239     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25240   auto saved_ctx = ctx();
25241   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25242   auto res = isl_union_map_range_factor_range(copy());
25243   if (!res)
25244     exception::throw_last_error(saved_ctx);
25245   return manage(res);
25246 }
25247 
range_map()25248 isl::union_map union_map::range_map() const
25249 {
25250   if (!ptr)
25251     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25252   auto saved_ctx = ctx();
25253   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25254   auto res = isl_union_map_range_map(copy());
25255   if (!res)
25256     exception::throw_last_error(saved_ctx);
25257   return manage(res);
25258 }
25259 
range_product(isl::union_map umap2)25260 isl::union_map union_map::range_product(isl::union_map umap2) const
25261 {
25262   if (!ptr || umap2.is_null())
25263     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25264   auto saved_ctx = ctx();
25265   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25266   auto res = isl_union_map_range_product(copy(), umap2.release());
25267   if (!res)
25268     exception::throw_last_error(saved_ctx);
25269   return manage(res);
25270 }
25271 
range_reverse()25272 isl::union_map union_map::range_reverse() const
25273 {
25274   if (!ptr)
25275     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25276   auto saved_ctx = ctx();
25277   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25278   auto res = isl_union_map_range_reverse(copy());
25279   if (!res)
25280     exception::throw_last_error(saved_ctx);
25281   return manage(res);
25282 }
25283 
reverse()25284 isl::union_map union_map::reverse() const
25285 {
25286   if (!ptr)
25287     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25288   auto saved_ctx = ctx();
25289   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25290   auto res = isl_union_map_reverse(copy());
25291   if (!res)
25292     exception::throw_last_error(saved_ctx);
25293   return manage(res);
25294 }
25295 
space()25296 isl::space union_map::space() const
25297 {
25298   if (!ptr)
25299     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25300   auto saved_ctx = ctx();
25301   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25302   auto res = isl_union_map_get_space(get());
25303   if (!res)
25304     exception::throw_last_error(saved_ctx);
25305   return manage(res);
25306 }
25307 
get_space()25308 isl::space union_map::get_space() const
25309 {
25310   return space();
25311 }
25312 
subtract(isl::union_map umap2)25313 isl::union_map union_map::subtract(isl::union_map umap2) const
25314 {
25315   if (!ptr || umap2.is_null())
25316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25317   auto saved_ctx = ctx();
25318   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25319   auto res = isl_union_map_subtract(copy(), umap2.release());
25320   if (!res)
25321     exception::throw_last_error(saved_ctx);
25322   return manage(res);
25323 }
25324 
subtract_domain(isl::union_set dom)25325 isl::union_map union_map::subtract_domain(isl::union_set dom) const
25326 {
25327   if (!ptr || dom.is_null())
25328     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25329   auto saved_ctx = ctx();
25330   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25331   auto res = isl_union_map_subtract_domain(copy(), dom.release());
25332   if (!res)
25333     exception::throw_last_error(saved_ctx);
25334   return manage(res);
25335 }
25336 
subtract_range(isl::union_set dom)25337 isl::union_map union_map::subtract_range(isl::union_set dom) const
25338 {
25339   if (!ptr || dom.is_null())
25340     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25341   auto saved_ctx = ctx();
25342   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25343   auto res = isl_union_map_subtract_range(copy(), dom.release());
25344   if (!res)
25345     exception::throw_last_error(saved_ctx);
25346   return manage(res);
25347 }
25348 
uncurry()25349 isl::union_map union_map::uncurry() const
25350 {
25351   if (!ptr)
25352     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25353   auto saved_ctx = ctx();
25354   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25355   auto res = isl_union_map_uncurry(copy());
25356   if (!res)
25357     exception::throw_last_error(saved_ctx);
25358   return manage(res);
25359 }
25360 
unite(isl::union_map umap2)25361 isl::union_map union_map::unite(isl::union_map umap2) const
25362 {
25363   if (!ptr || umap2.is_null())
25364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25365   auto saved_ctx = ctx();
25366   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25367   auto res = isl_union_map_union(copy(), umap2.release());
25368   if (!res)
25369     exception::throw_last_error(saved_ctx);
25370   return manage(res);
25371 }
25372 
universe()25373 isl::union_map union_map::universe() const
25374 {
25375   if (!ptr)
25376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25377   auto saved_ctx = ctx();
25378   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25379   auto res = isl_union_map_universe(copy());
25380   if (!res)
25381     exception::throw_last_error(saved_ctx);
25382   return manage(res);
25383 }
25384 
wrap()25385 isl::union_set union_map::wrap() const
25386 {
25387   if (!ptr)
25388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25389   auto saved_ctx = ctx();
25390   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25391   auto res = isl_union_map_wrap(copy());
25392   if (!res)
25393     exception::throw_last_error(saved_ctx);
25394   return manage(res);
25395 }
25396 
zip()25397 isl::union_map union_map::zip() const
25398 {
25399   if (!ptr)
25400     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25401   auto saved_ctx = ctx();
25402   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25403   auto res = isl_union_map_zip(copy());
25404   if (!res)
25405     exception::throw_last_error(saved_ctx);
25406   return manage(res);
25407 }
25408 
25409 inline std::ostream &operator<<(std::ostream &os, const union_map &obj)
25410 {
25411   if (!obj.get())
25412     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25413   auto saved_ctx = isl_union_map_get_ctx(obj.get());
25414   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25415   char *str = isl_union_map_to_str(obj.get());
25416   if (!str)
25417     exception::throw_last_error(saved_ctx);
25418   os << str;
25419   free(str);
25420   return os;
25421 }
25422 
25423 // implementations for isl::union_pw_aff
manage(__isl_take isl_union_pw_aff * ptr)25424 union_pw_aff manage(__isl_take isl_union_pw_aff *ptr) {
25425   if (!ptr)
25426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25427   return union_pw_aff(ptr);
25428 }
manage_copy(__isl_keep isl_union_pw_aff * ptr)25429 union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr) {
25430   if (!ptr)
25431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25432   auto saved_ctx = isl_union_pw_aff_get_ctx(ptr);
25433   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25434   ptr = isl_union_pw_aff_copy(ptr);
25435   if (!ptr)
25436     exception::throw_last_error(saved_ctx);
25437   return union_pw_aff(ptr);
25438 }
25439 
union_pw_aff()25440 union_pw_aff::union_pw_aff()
25441     : ptr(nullptr) {}
25442 
union_pw_aff(const union_pw_aff & obj)25443 union_pw_aff::union_pw_aff(const union_pw_aff &obj)
25444     : ptr(nullptr)
25445 {
25446   if (!obj.ptr)
25447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25448   auto saved_ctx = isl_union_pw_aff_get_ctx(obj.ptr);
25449   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25450   ptr = obj.copy();
25451   if (!ptr)
25452     exception::throw_last_error(saved_ctx);
25453 }
25454 
union_pw_aff(__isl_take isl_union_pw_aff * ptr)25455 union_pw_aff::union_pw_aff(__isl_take isl_union_pw_aff *ptr)
25456     : ptr(ptr) {}
25457 
union_pw_aff(isl::aff aff)25458 union_pw_aff::union_pw_aff(isl::aff aff)
25459 {
25460   if (aff.is_null())
25461     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25462   auto saved_ctx = aff.ctx();
25463   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25464   auto res = isl_union_pw_aff_from_aff(aff.release());
25465   if (!res)
25466     exception::throw_last_error(saved_ctx);
25467   ptr = res;
25468 }
25469 
union_pw_aff(isl::pw_aff pa)25470 union_pw_aff::union_pw_aff(isl::pw_aff pa)
25471 {
25472   if (pa.is_null())
25473     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25474   auto saved_ctx = pa.ctx();
25475   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25476   auto res = isl_union_pw_aff_from_pw_aff(pa.release());
25477   if (!res)
25478     exception::throw_last_error(saved_ctx);
25479   ptr = res;
25480 }
25481 
union_pw_aff(isl::ctx ctx,const std::string & str)25482 union_pw_aff::union_pw_aff(isl::ctx ctx, const std::string &str)
25483 {
25484   auto saved_ctx = ctx;
25485   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25486   auto res = isl_union_pw_aff_read_from_str(ctx.release(), str.c_str());
25487   if (!res)
25488     exception::throw_last_error(saved_ctx);
25489   ptr = res;
25490 }
25491 
25492 union_pw_aff &union_pw_aff::operator=(union_pw_aff obj) {
25493   std::swap(this->ptr, obj.ptr);
25494   return *this;
25495 }
25496 
~union_pw_aff()25497 union_pw_aff::~union_pw_aff() {
25498   if (ptr)
25499     isl_union_pw_aff_free(ptr);
25500 }
25501 
copy()25502 __isl_give isl_union_pw_aff *union_pw_aff::copy() const & {
25503   return isl_union_pw_aff_copy(ptr);
25504 }
25505 
get()25506 __isl_keep isl_union_pw_aff *union_pw_aff::get() const {
25507   return ptr;
25508 }
25509 
release()25510 __isl_give isl_union_pw_aff *union_pw_aff::release() {
25511   isl_union_pw_aff *tmp = ptr;
25512   ptr = nullptr;
25513   return tmp;
25514 }
25515 
is_null()25516 bool union_pw_aff::is_null() const {
25517   return ptr == nullptr;
25518 }
25519 
ctx()25520 isl::ctx union_pw_aff::ctx() const {
25521   return isl::ctx(isl_union_pw_aff_get_ctx(ptr));
25522 }
25523 
add(const isl::multi_union_pw_aff & multi2)25524 isl::multi_union_pw_aff union_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
25525 {
25526   if (!ptr)
25527     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25528   return isl::multi_union_pw_aff(*this).add(multi2);
25529 }
25530 
add(isl::union_pw_aff upa2)25531 isl::union_pw_aff union_pw_aff::add(isl::union_pw_aff upa2) const
25532 {
25533   if (!ptr || upa2.is_null())
25534     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25535   auto saved_ctx = ctx();
25536   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25537   auto res = isl_union_pw_aff_add(copy(), upa2.release());
25538   if (!res)
25539     exception::throw_last_error(saved_ctx);
25540   return manage(res);
25541 }
25542 
add(const isl::union_pw_multi_aff & upma2)25543 isl::union_pw_multi_aff union_pw_aff::add(const isl::union_pw_multi_aff &upma2) const
25544 {
25545   if (!ptr)
25546     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25547   return isl::union_pw_multi_aff(*this).add(upma2);
25548 }
25549 
add(const isl::aff & upa2)25550 isl::union_pw_aff union_pw_aff::add(const isl::aff &upa2) const
25551 {
25552   if (!ptr)
25553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25554   return this->add(isl::union_pw_aff(upa2));
25555 }
25556 
add(const isl::pw_aff & upa2)25557 isl::union_pw_aff union_pw_aff::add(const isl::pw_aff &upa2) const
25558 {
25559   if (!ptr)
25560     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25561   return this->add(isl::union_pw_aff(upa2));
25562 }
25563 
apply(const isl::union_pw_multi_aff & upma2)25564 isl::union_pw_multi_aff union_pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
25565 {
25566   if (!ptr)
25567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25568   return isl::union_pw_multi_aff(*this).apply(upma2);
25569 }
25570 
as_multi_union_pw_aff()25571 isl::multi_union_pw_aff union_pw_aff::as_multi_union_pw_aff() const
25572 {
25573   if (!ptr)
25574     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25575   return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
25576 }
25577 
as_pw_multi_aff()25578 isl::pw_multi_aff union_pw_aff::as_pw_multi_aff() const
25579 {
25580   if (!ptr)
25581     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25582   return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
25583 }
25584 
as_union_map()25585 isl::union_map union_pw_aff::as_union_map() const
25586 {
25587   if (!ptr)
25588     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25589   return isl::union_pw_multi_aff(*this).as_union_map();
25590 }
25591 
at(int pos)25592 isl::union_pw_aff union_pw_aff::at(int pos) const
25593 {
25594   if (!ptr)
25595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25596   return isl::multi_union_pw_aff(*this).at(pos);
25597 }
25598 
bind(const isl::multi_id & tuple)25599 isl::union_set union_pw_aff::bind(const isl::multi_id &tuple) const
25600 {
25601   if (!ptr)
25602     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25603   return isl::multi_union_pw_aff(*this).bind(tuple);
25604 }
25605 
bind(isl::id id)25606 isl::union_set union_pw_aff::bind(isl::id id) const
25607 {
25608   if (!ptr || id.is_null())
25609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25610   auto saved_ctx = ctx();
25611   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25612   auto res = isl_union_pw_aff_bind_id(copy(), id.release());
25613   if (!res)
25614     exception::throw_last_error(saved_ctx);
25615   return manage(res);
25616 }
25617 
bind(const std::string & id)25618 isl::union_set union_pw_aff::bind(const std::string &id) const
25619 {
25620   if (!ptr)
25621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25622   return this->bind(isl::id(ctx(), id));
25623 }
25624 
coalesce()25625 isl::union_pw_aff union_pw_aff::coalesce() const
25626 {
25627   if (!ptr)
25628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25629   auto saved_ctx = ctx();
25630   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25631   auto res = isl_union_pw_aff_coalesce(copy());
25632   if (!res)
25633     exception::throw_last_error(saved_ctx);
25634   return manage(res);
25635 }
25636 
domain()25637 isl::union_set union_pw_aff::domain() const
25638 {
25639   if (!ptr)
25640     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25641   auto saved_ctx = ctx();
25642   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25643   auto res = isl_union_pw_aff_domain(copy());
25644   if (!res)
25645     exception::throw_last_error(saved_ctx);
25646   return manage(res);
25647 }
25648 
extract_pw_multi_aff(const isl::space & space)25649 isl::pw_multi_aff union_pw_aff::extract_pw_multi_aff(const isl::space &space) const
25650 {
25651   if (!ptr)
25652     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25653   return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
25654 }
25655 
flat_range_product(const isl::multi_union_pw_aff & multi2)25656 isl::multi_union_pw_aff union_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
25657 {
25658   if (!ptr)
25659     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25660   return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
25661 }
25662 
flat_range_product(const isl::union_pw_multi_aff & upma2)25663 isl::union_pw_multi_aff union_pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
25664 {
25665   if (!ptr)
25666     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25667   return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
25668 }
25669 
gist(isl::union_set context)25670 isl::union_pw_aff union_pw_aff::gist(isl::union_set context) const
25671 {
25672   if (!ptr || context.is_null())
25673     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25674   auto saved_ctx = ctx();
25675   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25676   auto res = isl_union_pw_aff_gist(copy(), context.release());
25677   if (!res)
25678     exception::throw_last_error(saved_ctx);
25679   return manage(res);
25680 }
25681 
has_range_tuple_id()25682 bool union_pw_aff::has_range_tuple_id() const
25683 {
25684   if (!ptr)
25685     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25686   return isl::multi_union_pw_aff(*this).has_range_tuple_id();
25687 }
25688 
intersect_domain(isl::space space)25689 isl::union_pw_aff union_pw_aff::intersect_domain(isl::space space) const
25690 {
25691   if (!ptr || space.is_null())
25692     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25693   auto saved_ctx = ctx();
25694   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25695   auto res = isl_union_pw_aff_intersect_domain_space(copy(), space.release());
25696   if (!res)
25697     exception::throw_last_error(saved_ctx);
25698   return manage(res);
25699 }
25700 
intersect_domain(isl::union_set uset)25701 isl::union_pw_aff union_pw_aff::intersect_domain(isl::union_set uset) const
25702 {
25703   if (!ptr || uset.is_null())
25704     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25705   auto saved_ctx = ctx();
25706   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25707   auto res = isl_union_pw_aff_intersect_domain_union_set(copy(), uset.release());
25708   if (!res)
25709     exception::throw_last_error(saved_ctx);
25710   return manage(res);
25711 }
25712 
intersect_domain_wrapped_domain(isl::union_set uset)25713 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
25714 {
25715   if (!ptr || uset.is_null())
25716     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25717   auto saved_ctx = ctx();
25718   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25719   auto res = isl_union_pw_aff_intersect_domain_wrapped_domain(copy(), uset.release());
25720   if (!res)
25721     exception::throw_last_error(saved_ctx);
25722   return manage(res);
25723 }
25724 
intersect_domain_wrapped_range(isl::union_set uset)25725 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_range(isl::union_set uset) const
25726 {
25727   if (!ptr || uset.is_null())
25728     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25729   auto saved_ctx = ctx();
25730   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25731   auto res = isl_union_pw_aff_intersect_domain_wrapped_range(copy(), uset.release());
25732   if (!res)
25733     exception::throw_last_error(saved_ctx);
25734   return manage(res);
25735 }
25736 
intersect_params(isl::set set)25737 isl::union_pw_aff union_pw_aff::intersect_params(isl::set set) const
25738 {
25739   if (!ptr || set.is_null())
25740     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25741   auto saved_ctx = ctx();
25742   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25743   auto res = isl_union_pw_aff_intersect_params(copy(), set.release());
25744   if (!res)
25745     exception::throw_last_error(saved_ctx);
25746   return manage(res);
25747 }
25748 
involves_locals()25749 bool union_pw_aff::involves_locals() const
25750 {
25751   if (!ptr)
25752     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25753   return isl::union_pw_multi_aff(*this).involves_locals();
25754 }
25755 
involves_nan()25756 bool union_pw_aff::involves_nan() const
25757 {
25758   if (!ptr)
25759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25760   return isl::multi_union_pw_aff(*this).involves_nan();
25761 }
25762 
isa_pw_multi_aff()25763 bool union_pw_aff::isa_pw_multi_aff() const
25764 {
25765   if (!ptr)
25766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25767   return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
25768 }
25769 
list()25770 isl::union_pw_aff_list union_pw_aff::list() const
25771 {
25772   if (!ptr)
25773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25774   return isl::multi_union_pw_aff(*this).list();
25775 }
25776 
neg()25777 isl::multi_union_pw_aff union_pw_aff::neg() const
25778 {
25779   if (!ptr)
25780     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25781   return isl::multi_union_pw_aff(*this).neg();
25782 }
25783 
plain_is_empty()25784 bool union_pw_aff::plain_is_empty() const
25785 {
25786   if (!ptr)
25787     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25788   return isl::union_pw_multi_aff(*this).plain_is_empty();
25789 }
25790 
plain_is_equal(const isl::multi_union_pw_aff & multi2)25791 bool union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
25792 {
25793   if (!ptr)
25794     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25795   return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
25796 }
25797 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)25798 isl::union_pw_multi_aff union_pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
25799 {
25800   if (!ptr)
25801     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25802   return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
25803 }
25804 
pullback(isl::union_pw_multi_aff upma)25805 isl::union_pw_aff union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
25806 {
25807   if (!ptr || upma.is_null())
25808     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25809   auto saved_ctx = ctx();
25810   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25811   auto res = isl_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
25812   if (!res)
25813     exception::throw_last_error(saved_ctx);
25814   return manage(res);
25815 }
25816 
pw_multi_aff_list()25817 isl::pw_multi_aff_list union_pw_aff::pw_multi_aff_list() const
25818 {
25819   if (!ptr)
25820     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25821   return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
25822 }
25823 
range_factor_domain()25824 isl::union_pw_multi_aff union_pw_aff::range_factor_domain() const
25825 {
25826   if (!ptr)
25827     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25828   return isl::union_pw_multi_aff(*this).range_factor_domain();
25829 }
25830 
range_factor_range()25831 isl::union_pw_multi_aff union_pw_aff::range_factor_range() const
25832 {
25833   if (!ptr)
25834     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25835   return isl::union_pw_multi_aff(*this).range_factor_range();
25836 }
25837 
range_product(const isl::multi_union_pw_aff & multi2)25838 isl::multi_union_pw_aff union_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
25839 {
25840   if (!ptr)
25841     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25842   return isl::multi_union_pw_aff(*this).range_product(multi2);
25843 }
25844 
range_product(const isl::union_pw_multi_aff & upma2)25845 isl::union_pw_multi_aff union_pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
25846 {
25847   if (!ptr)
25848     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25849   return isl::union_pw_multi_aff(*this).range_product(upma2);
25850 }
25851 
range_tuple_id()25852 isl::id union_pw_aff::range_tuple_id() const
25853 {
25854   if (!ptr)
25855     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25856   return isl::multi_union_pw_aff(*this).range_tuple_id();
25857 }
25858 
reset_range_tuple_id()25859 isl::multi_union_pw_aff union_pw_aff::reset_range_tuple_id() const
25860 {
25861   if (!ptr)
25862     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25863   return isl::multi_union_pw_aff(*this).reset_range_tuple_id();
25864 }
25865 
scale(const isl::multi_val & mv)25866 isl::multi_union_pw_aff union_pw_aff::scale(const isl::multi_val &mv) const
25867 {
25868   if (!ptr)
25869     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25870   return isl::multi_union_pw_aff(*this).scale(mv);
25871 }
25872 
scale(const isl::val & v)25873 isl::multi_union_pw_aff union_pw_aff::scale(const isl::val &v) const
25874 {
25875   if (!ptr)
25876     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25877   return isl::multi_union_pw_aff(*this).scale(v);
25878 }
25879 
scale(long v)25880 isl::multi_union_pw_aff union_pw_aff::scale(long v) const
25881 {
25882   if (!ptr)
25883     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25884   return this->scale(isl::val(ctx(), v));
25885 }
25886 
scale_down(const isl::multi_val & mv)25887 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::multi_val &mv) const
25888 {
25889   if (!ptr)
25890     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25891   return isl::multi_union_pw_aff(*this).scale_down(mv);
25892 }
25893 
scale_down(const isl::val & v)25894 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::val &v) const
25895 {
25896   if (!ptr)
25897     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25898   return isl::multi_union_pw_aff(*this).scale_down(v);
25899 }
25900 
scale_down(long v)25901 isl::multi_union_pw_aff union_pw_aff::scale_down(long v) const
25902 {
25903   if (!ptr)
25904     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25905   return this->scale_down(isl::val(ctx(), v));
25906 }
25907 
set_at(int pos,const isl::union_pw_aff & el)25908 isl::multi_union_pw_aff union_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
25909 {
25910   if (!ptr)
25911     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25912   return isl::multi_union_pw_aff(*this).set_at(pos, el);
25913 }
25914 
set_range_tuple(const isl::id & id)25915 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const isl::id &id) const
25916 {
25917   if (!ptr)
25918     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25919   return isl::multi_union_pw_aff(*this).set_range_tuple(id);
25920 }
25921 
set_range_tuple(const std::string & id)25922 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const std::string &id) const
25923 {
25924   if (!ptr)
25925     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25926   return this->set_range_tuple(isl::id(ctx(), id));
25927 }
25928 
size()25929 unsigned union_pw_aff::size() const
25930 {
25931   if (!ptr)
25932     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25933   return isl::multi_union_pw_aff(*this).size();
25934 }
25935 
space()25936 isl::space union_pw_aff::space() const
25937 {
25938   if (!ptr)
25939     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25940   auto saved_ctx = ctx();
25941   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25942   auto res = isl_union_pw_aff_get_space(get());
25943   if (!res)
25944     exception::throw_last_error(saved_ctx);
25945   return manage(res);
25946 }
25947 
get_space()25948 isl::space union_pw_aff::get_space() const
25949 {
25950   return space();
25951 }
25952 
sub(const isl::multi_union_pw_aff & multi2)25953 isl::multi_union_pw_aff union_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
25954 {
25955   if (!ptr)
25956     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25957   return isl::multi_union_pw_aff(*this).sub(multi2);
25958 }
25959 
sub(isl::union_pw_aff upa2)25960 isl::union_pw_aff union_pw_aff::sub(isl::union_pw_aff upa2) const
25961 {
25962   if (!ptr || upa2.is_null())
25963     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25964   auto saved_ctx = ctx();
25965   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25966   auto res = isl_union_pw_aff_sub(copy(), upa2.release());
25967   if (!res)
25968     exception::throw_last_error(saved_ctx);
25969   return manage(res);
25970 }
25971 
sub(const isl::union_pw_multi_aff & upma2)25972 isl::union_pw_multi_aff union_pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
25973 {
25974   if (!ptr)
25975     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25976   return isl::union_pw_multi_aff(*this).sub(upma2);
25977 }
25978 
sub(const isl::aff & upa2)25979 isl::union_pw_aff union_pw_aff::sub(const isl::aff &upa2) const
25980 {
25981   if (!ptr)
25982     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25983   return this->sub(isl::union_pw_aff(upa2));
25984 }
25985 
sub(const isl::pw_aff & upa2)25986 isl::union_pw_aff union_pw_aff::sub(const isl::pw_aff &upa2) const
25987 {
25988   if (!ptr)
25989     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25990   return this->sub(isl::union_pw_aff(upa2));
25991 }
25992 
subtract_domain(isl::space space)25993 isl::union_pw_aff union_pw_aff::subtract_domain(isl::space space) const
25994 {
25995   if (!ptr || space.is_null())
25996     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25997   auto saved_ctx = ctx();
25998   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25999   auto res = isl_union_pw_aff_subtract_domain_space(copy(), space.release());
26000   if (!res)
26001     exception::throw_last_error(saved_ctx);
26002   return manage(res);
26003 }
26004 
subtract_domain(isl::union_set uset)26005 isl::union_pw_aff union_pw_aff::subtract_domain(isl::union_set uset) const
26006 {
26007   if (!ptr || uset.is_null())
26008     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26009   auto saved_ctx = ctx();
26010   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26011   auto res = isl_union_pw_aff_subtract_domain_union_set(copy(), uset.release());
26012   if (!res)
26013     exception::throw_last_error(saved_ctx);
26014   return manage(res);
26015 }
26016 
to_list()26017 isl::union_pw_aff_list union_pw_aff::to_list() const
26018 {
26019   if (!ptr)
26020     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26021   auto saved_ctx = ctx();
26022   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26023   auto res = isl_union_pw_aff_to_list(copy());
26024   if (!res)
26025     exception::throw_last_error(saved_ctx);
26026   return manage(res);
26027 }
26028 
union_add(const isl::multi_union_pw_aff & mupa2)26029 isl::multi_union_pw_aff union_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
26030 {
26031   if (!ptr)
26032     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26033   return isl::multi_union_pw_aff(*this).union_add(mupa2);
26034 }
26035 
union_add(isl::union_pw_aff upa2)26036 isl::union_pw_aff union_pw_aff::union_add(isl::union_pw_aff upa2) const
26037 {
26038   if (!ptr || upa2.is_null())
26039     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26040   auto saved_ctx = ctx();
26041   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26042   auto res = isl_union_pw_aff_union_add(copy(), upa2.release());
26043   if (!res)
26044     exception::throw_last_error(saved_ctx);
26045   return manage(res);
26046 }
26047 
union_add(const isl::union_pw_multi_aff & upma2)26048 isl::union_pw_multi_aff union_pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
26049 {
26050   if (!ptr)
26051     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26052   return isl::union_pw_multi_aff(*this).union_add(upma2);
26053 }
26054 
union_add(const isl::aff & upa2)26055 isl::union_pw_aff union_pw_aff::union_add(const isl::aff &upa2) const
26056 {
26057   if (!ptr)
26058     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26059   return this->union_add(isl::union_pw_aff(upa2));
26060 }
26061 
union_add(const isl::pw_aff & upa2)26062 isl::union_pw_aff union_pw_aff::union_add(const isl::pw_aff &upa2) const
26063 {
26064   if (!ptr)
26065     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26066   return this->union_add(isl::union_pw_aff(upa2));
26067 }
26068 
26069 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff &obj)
26070 {
26071   if (!obj.get())
26072     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26073   auto saved_ctx = isl_union_pw_aff_get_ctx(obj.get());
26074   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26075   char *str = isl_union_pw_aff_to_str(obj.get());
26076   if (!str)
26077     exception::throw_last_error(saved_ctx);
26078   os << str;
26079   free(str);
26080   return os;
26081 }
26082 
26083 // implementations for isl::union_pw_aff_list
manage(__isl_take isl_union_pw_aff_list * ptr)26084 union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr) {
26085   if (!ptr)
26086     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26087   return union_pw_aff_list(ptr);
26088 }
manage_copy(__isl_keep isl_union_pw_aff_list * ptr)26089 union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr) {
26090   if (!ptr)
26091     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26092   auto saved_ctx = isl_union_pw_aff_list_get_ctx(ptr);
26093   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26094   ptr = isl_union_pw_aff_list_copy(ptr);
26095   if (!ptr)
26096     exception::throw_last_error(saved_ctx);
26097   return union_pw_aff_list(ptr);
26098 }
26099 
union_pw_aff_list()26100 union_pw_aff_list::union_pw_aff_list()
26101     : ptr(nullptr) {}
26102 
union_pw_aff_list(const union_pw_aff_list & obj)26103 union_pw_aff_list::union_pw_aff_list(const union_pw_aff_list &obj)
26104     : ptr(nullptr)
26105 {
26106   if (!obj.ptr)
26107     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26108   auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.ptr);
26109   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26110   ptr = obj.copy();
26111   if (!ptr)
26112     exception::throw_last_error(saved_ctx);
26113 }
26114 
union_pw_aff_list(__isl_take isl_union_pw_aff_list * ptr)26115 union_pw_aff_list::union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr)
26116     : ptr(ptr) {}
26117 
union_pw_aff_list(isl::ctx ctx,int n)26118 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, int n)
26119 {
26120   auto saved_ctx = ctx;
26121   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26122   auto res = isl_union_pw_aff_list_alloc(ctx.release(), n);
26123   if (!res)
26124     exception::throw_last_error(saved_ctx);
26125   ptr = res;
26126 }
26127 
union_pw_aff_list(isl::union_pw_aff el)26128 union_pw_aff_list::union_pw_aff_list(isl::union_pw_aff el)
26129 {
26130   if (el.is_null())
26131     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26132   auto saved_ctx = el.ctx();
26133   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26134   auto res = isl_union_pw_aff_list_from_union_pw_aff(el.release());
26135   if (!res)
26136     exception::throw_last_error(saved_ctx);
26137   ptr = res;
26138 }
26139 
union_pw_aff_list(isl::ctx ctx,const std::string & str)26140 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, const std::string &str)
26141 {
26142   auto saved_ctx = ctx;
26143   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26144   auto res = isl_union_pw_aff_list_read_from_str(ctx.release(), str.c_str());
26145   if (!res)
26146     exception::throw_last_error(saved_ctx);
26147   ptr = res;
26148 }
26149 
26150 union_pw_aff_list &union_pw_aff_list::operator=(union_pw_aff_list obj) {
26151   std::swap(this->ptr, obj.ptr);
26152   return *this;
26153 }
26154 
~union_pw_aff_list()26155 union_pw_aff_list::~union_pw_aff_list() {
26156   if (ptr)
26157     isl_union_pw_aff_list_free(ptr);
26158 }
26159 
copy()26160 __isl_give isl_union_pw_aff_list *union_pw_aff_list::copy() const & {
26161   return isl_union_pw_aff_list_copy(ptr);
26162 }
26163 
get()26164 __isl_keep isl_union_pw_aff_list *union_pw_aff_list::get() const {
26165   return ptr;
26166 }
26167 
release()26168 __isl_give isl_union_pw_aff_list *union_pw_aff_list::release() {
26169   isl_union_pw_aff_list *tmp = ptr;
26170   ptr = nullptr;
26171   return tmp;
26172 }
26173 
is_null()26174 bool union_pw_aff_list::is_null() const {
26175   return ptr == nullptr;
26176 }
26177 
ctx()26178 isl::ctx union_pw_aff_list::ctx() const {
26179   return isl::ctx(isl_union_pw_aff_list_get_ctx(ptr));
26180 }
26181 
add(isl::union_pw_aff el)26182 isl::union_pw_aff_list union_pw_aff_list::add(isl::union_pw_aff el) const
26183 {
26184   if (!ptr || el.is_null())
26185     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26186   auto saved_ctx = ctx();
26187   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26188   auto res = isl_union_pw_aff_list_add(copy(), el.release());
26189   if (!res)
26190     exception::throw_last_error(saved_ctx);
26191   return manage(res);
26192 }
26193 
at(int index)26194 isl::union_pw_aff union_pw_aff_list::at(int index) const
26195 {
26196   if (!ptr)
26197     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26198   auto saved_ctx = ctx();
26199   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26200   auto res = isl_union_pw_aff_list_get_at(get(), index);
26201   if (!res)
26202     exception::throw_last_error(saved_ctx);
26203   return manage(res);
26204 }
26205 
get_at(int index)26206 isl::union_pw_aff union_pw_aff_list::get_at(int index) const
26207 {
26208   return at(index);
26209 }
26210 
clear()26211 isl::union_pw_aff_list union_pw_aff_list::clear() const
26212 {
26213   if (!ptr)
26214     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26215   auto saved_ctx = ctx();
26216   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26217   auto res = isl_union_pw_aff_list_clear(copy());
26218   if (!res)
26219     exception::throw_last_error(saved_ctx);
26220   return manage(res);
26221 }
26222 
concat(isl::union_pw_aff_list list2)26223 isl::union_pw_aff_list union_pw_aff_list::concat(isl::union_pw_aff_list list2) const
26224 {
26225   if (!ptr || list2.is_null())
26226     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26227   auto saved_ctx = ctx();
26228   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26229   auto res = isl_union_pw_aff_list_concat(copy(), list2.release());
26230   if (!res)
26231     exception::throw_last_error(saved_ctx);
26232   return manage(res);
26233 }
26234 
drop(unsigned int first,unsigned int n)26235 isl::union_pw_aff_list union_pw_aff_list::drop(unsigned int first, unsigned int n) const
26236 {
26237   if (!ptr)
26238     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26239   auto saved_ctx = ctx();
26240   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26241   auto res = isl_union_pw_aff_list_drop(copy(), first, n);
26242   if (!res)
26243     exception::throw_last_error(saved_ctx);
26244   return manage(res);
26245 }
26246 
foreach(const std::function<void (isl::union_pw_aff)> & fn)26247 void union_pw_aff_list::foreach(const std::function<void(isl::union_pw_aff)> &fn) const
26248 {
26249   if (!ptr)
26250     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26251   auto saved_ctx = ctx();
26252   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26253   struct fn_data {
26254     std::function<void(isl::union_pw_aff)> func;
26255     std::exception_ptr eptr;
26256   } fn_data = { fn };
26257   auto fn_lambda = [](isl_union_pw_aff *arg_0, void *arg_1) -> isl_stat {
26258     auto *data = static_cast<struct fn_data *>(arg_1);
26259     ISL_CPP_TRY {
26260       (data->func)(manage(arg_0));
26261       return isl_stat_ok;
26262     } ISL_CPP_CATCH_ALL {
26263       data->eptr = std::current_exception();
26264       return isl_stat_error;
26265     }
26266   };
26267   auto res = isl_union_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
26268   if (fn_data.eptr)
26269     std::rethrow_exception(fn_data.eptr);
26270   if (res < 0)
26271     exception::throw_last_error(saved_ctx);
26272   return;
26273 }
26274 
insert(unsigned int pos,isl::union_pw_aff el)26275 isl::union_pw_aff_list union_pw_aff_list::insert(unsigned int pos, isl::union_pw_aff el) const
26276 {
26277   if (!ptr || el.is_null())
26278     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26279   auto saved_ctx = ctx();
26280   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26281   auto res = isl_union_pw_aff_list_insert(copy(), pos, el.release());
26282   if (!res)
26283     exception::throw_last_error(saved_ctx);
26284   return manage(res);
26285 }
26286 
size()26287 unsigned union_pw_aff_list::size() const
26288 {
26289   if (!ptr)
26290     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26291   auto saved_ctx = ctx();
26292   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26293   auto res = isl_union_pw_aff_list_size(get());
26294   if (res < 0)
26295     exception::throw_last_error(saved_ctx);
26296   return res;
26297 }
26298 
26299 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff_list &obj)
26300 {
26301   if (!obj.get())
26302     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26303   auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.get());
26304   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26305   char *str = isl_union_pw_aff_list_to_str(obj.get());
26306   if (!str)
26307     exception::throw_last_error(saved_ctx);
26308   os << str;
26309   free(str);
26310   return os;
26311 }
26312 
26313 // implementations for isl::union_pw_multi_aff
manage(__isl_take isl_union_pw_multi_aff * ptr)26314 union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr) {
26315   if (!ptr)
26316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26317   return union_pw_multi_aff(ptr);
26318 }
manage_copy(__isl_keep isl_union_pw_multi_aff * ptr)26319 union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr) {
26320   if (!ptr)
26321     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26322   auto saved_ctx = isl_union_pw_multi_aff_get_ctx(ptr);
26323   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26324   ptr = isl_union_pw_multi_aff_copy(ptr);
26325   if (!ptr)
26326     exception::throw_last_error(saved_ctx);
26327   return union_pw_multi_aff(ptr);
26328 }
26329 
union_pw_multi_aff()26330 union_pw_multi_aff::union_pw_multi_aff()
26331     : ptr(nullptr) {}
26332 
union_pw_multi_aff(const union_pw_multi_aff & obj)26333 union_pw_multi_aff::union_pw_multi_aff(const union_pw_multi_aff &obj)
26334     : ptr(nullptr)
26335 {
26336   if (!obj.ptr)
26337     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26338   auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.ptr);
26339   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26340   ptr = obj.copy();
26341   if (!ptr)
26342     exception::throw_last_error(saved_ctx);
26343 }
26344 
union_pw_multi_aff(__isl_take isl_union_pw_multi_aff * ptr)26345 union_pw_multi_aff::union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr)
26346     : ptr(ptr) {}
26347 
union_pw_multi_aff(isl::multi_aff ma)26348 union_pw_multi_aff::union_pw_multi_aff(isl::multi_aff ma)
26349 {
26350   if (ma.is_null())
26351     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26352   auto saved_ctx = ma.ctx();
26353   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26354   auto res = isl_union_pw_multi_aff_from_multi_aff(ma.release());
26355   if (!res)
26356     exception::throw_last_error(saved_ctx);
26357   ptr = res;
26358 }
26359 
union_pw_multi_aff(isl::pw_multi_aff pma)26360 union_pw_multi_aff::union_pw_multi_aff(isl::pw_multi_aff pma)
26361 {
26362   if (pma.is_null())
26363     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26364   auto saved_ctx = pma.ctx();
26365   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26366   auto res = isl_union_pw_multi_aff_from_pw_multi_aff(pma.release());
26367   if (!res)
26368     exception::throw_last_error(saved_ctx);
26369   ptr = res;
26370 }
26371 
union_pw_multi_aff(isl::union_pw_aff upa)26372 union_pw_multi_aff::union_pw_multi_aff(isl::union_pw_aff upa)
26373 {
26374   if (upa.is_null())
26375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26376   auto saved_ctx = upa.ctx();
26377   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26378   auto res = isl_union_pw_multi_aff_from_union_pw_aff(upa.release());
26379   if (!res)
26380     exception::throw_last_error(saved_ctx);
26381   ptr = res;
26382 }
26383 
union_pw_multi_aff(isl::ctx ctx,const std::string & str)26384 union_pw_multi_aff::union_pw_multi_aff(isl::ctx ctx, const std::string &str)
26385 {
26386   auto saved_ctx = ctx;
26387   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26388   auto res = isl_union_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
26389   if (!res)
26390     exception::throw_last_error(saved_ctx);
26391   ptr = res;
26392 }
26393 
26394 union_pw_multi_aff &union_pw_multi_aff::operator=(union_pw_multi_aff obj) {
26395   std::swap(this->ptr, obj.ptr);
26396   return *this;
26397 }
26398 
~union_pw_multi_aff()26399 union_pw_multi_aff::~union_pw_multi_aff() {
26400   if (ptr)
26401     isl_union_pw_multi_aff_free(ptr);
26402 }
26403 
copy()26404 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::copy() const & {
26405   return isl_union_pw_multi_aff_copy(ptr);
26406 }
26407 
get()26408 __isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::get() const {
26409   return ptr;
26410 }
26411 
release()26412 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::release() {
26413   isl_union_pw_multi_aff *tmp = ptr;
26414   ptr = nullptr;
26415   return tmp;
26416 }
26417 
is_null()26418 bool union_pw_multi_aff::is_null() const {
26419   return ptr == nullptr;
26420 }
26421 
ctx()26422 isl::ctx union_pw_multi_aff::ctx() const {
26423   return isl::ctx(isl_union_pw_multi_aff_get_ctx(ptr));
26424 }
26425 
add(isl::union_pw_multi_aff upma2)26426 isl::union_pw_multi_aff union_pw_multi_aff::add(isl::union_pw_multi_aff upma2) const
26427 {
26428   if (!ptr || upma2.is_null())
26429     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26430   auto saved_ctx = ctx();
26431   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26432   auto res = isl_union_pw_multi_aff_add(copy(), upma2.release());
26433   if (!res)
26434     exception::throw_last_error(saved_ctx);
26435   return manage(res);
26436 }
26437 
apply(isl::union_pw_multi_aff upma2)26438 isl::union_pw_multi_aff union_pw_multi_aff::apply(isl::union_pw_multi_aff upma2) const
26439 {
26440   if (!ptr || upma2.is_null())
26441     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26442   auto saved_ctx = ctx();
26443   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26444   auto res = isl_union_pw_multi_aff_apply_union_pw_multi_aff(copy(), upma2.release());
26445   if (!res)
26446     exception::throw_last_error(saved_ctx);
26447   return manage(res);
26448 }
26449 
as_multi_union_pw_aff()26450 isl::multi_union_pw_aff union_pw_multi_aff::as_multi_union_pw_aff() const
26451 {
26452   if (!ptr)
26453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26454   auto saved_ctx = ctx();
26455   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26456   auto res = isl_union_pw_multi_aff_as_multi_union_pw_aff(copy());
26457   if (!res)
26458     exception::throw_last_error(saved_ctx);
26459   return manage(res);
26460 }
26461 
as_pw_multi_aff()26462 isl::pw_multi_aff union_pw_multi_aff::as_pw_multi_aff() const
26463 {
26464   if (!ptr)
26465     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26466   auto saved_ctx = ctx();
26467   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26468   auto res = isl_union_pw_multi_aff_as_pw_multi_aff(copy());
26469   if (!res)
26470     exception::throw_last_error(saved_ctx);
26471   return manage(res);
26472 }
26473 
as_union_map()26474 isl::union_map union_pw_multi_aff::as_union_map() const
26475 {
26476   if (!ptr)
26477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26478   auto saved_ctx = ctx();
26479   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26480   auto res = isl_union_pw_multi_aff_as_union_map(copy());
26481   if (!res)
26482     exception::throw_last_error(saved_ctx);
26483   return manage(res);
26484 }
26485 
coalesce()26486 isl::union_pw_multi_aff union_pw_multi_aff::coalesce() const
26487 {
26488   if (!ptr)
26489     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26490   auto saved_ctx = ctx();
26491   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26492   auto res = isl_union_pw_multi_aff_coalesce(copy());
26493   if (!res)
26494     exception::throw_last_error(saved_ctx);
26495   return manage(res);
26496 }
26497 
domain()26498 isl::union_set union_pw_multi_aff::domain() const
26499 {
26500   if (!ptr)
26501     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26502   auto saved_ctx = ctx();
26503   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26504   auto res = isl_union_pw_multi_aff_domain(copy());
26505   if (!res)
26506     exception::throw_last_error(saved_ctx);
26507   return manage(res);
26508 }
26509 
empty(isl::ctx ctx)26510 isl::union_pw_multi_aff union_pw_multi_aff::empty(isl::ctx ctx)
26511 {
26512   auto saved_ctx = ctx;
26513   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26514   auto res = isl_union_pw_multi_aff_empty_ctx(ctx.release());
26515   if (!res)
26516     exception::throw_last_error(saved_ctx);
26517   return manage(res);
26518 }
26519 
extract_pw_multi_aff(isl::space space)26520 isl::pw_multi_aff union_pw_multi_aff::extract_pw_multi_aff(isl::space space) const
26521 {
26522   if (!ptr || space.is_null())
26523     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26524   auto saved_ctx = ctx();
26525   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26526   auto res = isl_union_pw_multi_aff_extract_pw_multi_aff(get(), space.release());
26527   if (!res)
26528     exception::throw_last_error(saved_ctx);
26529   return manage(res);
26530 }
26531 
flat_range_product(isl::union_pw_multi_aff upma2)26532 isl::union_pw_multi_aff union_pw_multi_aff::flat_range_product(isl::union_pw_multi_aff upma2) const
26533 {
26534   if (!ptr || upma2.is_null())
26535     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26536   auto saved_ctx = ctx();
26537   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26538   auto res = isl_union_pw_multi_aff_flat_range_product(copy(), upma2.release());
26539   if (!res)
26540     exception::throw_last_error(saved_ctx);
26541   return manage(res);
26542 }
26543 
gist(isl::union_set context)26544 isl::union_pw_multi_aff union_pw_multi_aff::gist(isl::union_set context) const
26545 {
26546   if (!ptr || context.is_null())
26547     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26548   auto saved_ctx = ctx();
26549   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26550   auto res = isl_union_pw_multi_aff_gist(copy(), context.release());
26551   if (!res)
26552     exception::throw_last_error(saved_ctx);
26553   return manage(res);
26554 }
26555 
intersect_domain(isl::space space)26556 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::space space) const
26557 {
26558   if (!ptr || space.is_null())
26559     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26560   auto saved_ctx = ctx();
26561   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26562   auto res = isl_union_pw_multi_aff_intersect_domain_space(copy(), space.release());
26563   if (!res)
26564     exception::throw_last_error(saved_ctx);
26565   return manage(res);
26566 }
26567 
intersect_domain(isl::union_set uset)26568 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::union_set uset) const
26569 {
26570   if (!ptr || uset.is_null())
26571     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26572   auto saved_ctx = ctx();
26573   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26574   auto res = isl_union_pw_multi_aff_intersect_domain_union_set(copy(), uset.release());
26575   if (!res)
26576     exception::throw_last_error(saved_ctx);
26577   return manage(res);
26578 }
26579 
intersect_domain_wrapped_domain(isl::union_set uset)26580 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
26581 {
26582   if (!ptr || uset.is_null())
26583     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26584   auto saved_ctx = ctx();
26585   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26586   auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_domain(copy(), uset.release());
26587   if (!res)
26588     exception::throw_last_error(saved_ctx);
26589   return manage(res);
26590 }
26591 
intersect_domain_wrapped_range(isl::union_set uset)26592 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_range(isl::union_set uset) const
26593 {
26594   if (!ptr || uset.is_null())
26595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26596   auto saved_ctx = ctx();
26597   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26598   auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_range(copy(), uset.release());
26599   if (!res)
26600     exception::throw_last_error(saved_ctx);
26601   return manage(res);
26602 }
26603 
intersect_params(isl::set set)26604 isl::union_pw_multi_aff union_pw_multi_aff::intersect_params(isl::set set) const
26605 {
26606   if (!ptr || set.is_null())
26607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26608   auto saved_ctx = ctx();
26609   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26610   auto res = isl_union_pw_multi_aff_intersect_params(copy(), set.release());
26611   if (!res)
26612     exception::throw_last_error(saved_ctx);
26613   return manage(res);
26614 }
26615 
involves_locals()26616 bool union_pw_multi_aff::involves_locals() const
26617 {
26618   if (!ptr)
26619     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26620   auto saved_ctx = ctx();
26621   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26622   auto res = isl_union_pw_multi_aff_involves_locals(get());
26623   if (res < 0)
26624     exception::throw_last_error(saved_ctx);
26625   return res;
26626 }
26627 
isa_pw_multi_aff()26628 bool union_pw_multi_aff::isa_pw_multi_aff() const
26629 {
26630   if (!ptr)
26631     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26632   auto saved_ctx = ctx();
26633   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26634   auto res = isl_union_pw_multi_aff_isa_pw_multi_aff(get());
26635   if (res < 0)
26636     exception::throw_last_error(saved_ctx);
26637   return res;
26638 }
26639 
plain_is_empty()26640 bool union_pw_multi_aff::plain_is_empty() const
26641 {
26642   if (!ptr)
26643     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26644   auto saved_ctx = ctx();
26645   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26646   auto res = isl_union_pw_multi_aff_plain_is_empty(get());
26647   if (res < 0)
26648     exception::throw_last_error(saved_ctx);
26649   return res;
26650 }
26651 
preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2)26652 isl::union_pw_multi_aff union_pw_multi_aff::preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const
26653 {
26654   if (!ptr || upma2.is_null())
26655     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26656   auto saved_ctx = ctx();
26657   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26658   auto res = isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff(copy(), upma2.release());
26659   if (!res)
26660     exception::throw_last_error(saved_ctx);
26661   return manage(res);
26662 }
26663 
pullback(isl::union_pw_multi_aff upma2)26664 isl::union_pw_multi_aff union_pw_multi_aff::pullback(isl::union_pw_multi_aff upma2) const
26665 {
26666   if (!ptr || upma2.is_null())
26667     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26668   auto saved_ctx = ctx();
26669   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26670   auto res = isl_union_pw_multi_aff_pullback_union_pw_multi_aff(copy(), upma2.release());
26671   if (!res)
26672     exception::throw_last_error(saved_ctx);
26673   return manage(res);
26674 }
26675 
pw_multi_aff_list()26676 isl::pw_multi_aff_list union_pw_multi_aff::pw_multi_aff_list() const
26677 {
26678   if (!ptr)
26679     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26680   auto saved_ctx = ctx();
26681   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26682   auto res = isl_union_pw_multi_aff_get_pw_multi_aff_list(get());
26683   if (!res)
26684     exception::throw_last_error(saved_ctx);
26685   return manage(res);
26686 }
26687 
get_pw_multi_aff_list()26688 isl::pw_multi_aff_list union_pw_multi_aff::get_pw_multi_aff_list() const
26689 {
26690   return pw_multi_aff_list();
26691 }
26692 
range_factor_domain()26693 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_domain() const
26694 {
26695   if (!ptr)
26696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26697   auto saved_ctx = ctx();
26698   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26699   auto res = isl_union_pw_multi_aff_range_factor_domain(copy());
26700   if (!res)
26701     exception::throw_last_error(saved_ctx);
26702   return manage(res);
26703 }
26704 
range_factor_range()26705 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_range() const
26706 {
26707   if (!ptr)
26708     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26709   auto saved_ctx = ctx();
26710   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26711   auto res = isl_union_pw_multi_aff_range_factor_range(copy());
26712   if (!res)
26713     exception::throw_last_error(saved_ctx);
26714   return manage(res);
26715 }
26716 
range_product(isl::union_pw_multi_aff upma2)26717 isl::union_pw_multi_aff union_pw_multi_aff::range_product(isl::union_pw_multi_aff upma2) const
26718 {
26719   if (!ptr || upma2.is_null())
26720     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26721   auto saved_ctx = ctx();
26722   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26723   auto res = isl_union_pw_multi_aff_range_product(copy(), upma2.release());
26724   if (!res)
26725     exception::throw_last_error(saved_ctx);
26726   return manage(res);
26727 }
26728 
space()26729 isl::space union_pw_multi_aff::space() const
26730 {
26731   if (!ptr)
26732     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26733   auto saved_ctx = ctx();
26734   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26735   auto res = isl_union_pw_multi_aff_get_space(get());
26736   if (!res)
26737     exception::throw_last_error(saved_ctx);
26738   return manage(res);
26739 }
26740 
get_space()26741 isl::space union_pw_multi_aff::get_space() const
26742 {
26743   return space();
26744 }
26745 
sub(isl::union_pw_multi_aff upma2)26746 isl::union_pw_multi_aff union_pw_multi_aff::sub(isl::union_pw_multi_aff upma2) const
26747 {
26748   if (!ptr || upma2.is_null())
26749     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26750   auto saved_ctx = ctx();
26751   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26752   auto res = isl_union_pw_multi_aff_sub(copy(), upma2.release());
26753   if (!res)
26754     exception::throw_last_error(saved_ctx);
26755   return manage(res);
26756 }
26757 
subtract_domain(isl::space space)26758 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::space space) const
26759 {
26760   if (!ptr || space.is_null())
26761     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26762   auto saved_ctx = ctx();
26763   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26764   auto res = isl_union_pw_multi_aff_subtract_domain_space(copy(), space.release());
26765   if (!res)
26766     exception::throw_last_error(saved_ctx);
26767   return manage(res);
26768 }
26769 
subtract_domain(isl::union_set uset)26770 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::union_set uset) const
26771 {
26772   if (!ptr || uset.is_null())
26773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26774   auto saved_ctx = ctx();
26775   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26776   auto res = isl_union_pw_multi_aff_subtract_domain_union_set(copy(), uset.release());
26777   if (!res)
26778     exception::throw_last_error(saved_ctx);
26779   return manage(res);
26780 }
26781 
union_add(isl::union_pw_multi_aff upma2)26782 isl::union_pw_multi_aff union_pw_multi_aff::union_add(isl::union_pw_multi_aff upma2) const
26783 {
26784   if (!ptr || upma2.is_null())
26785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26786   auto saved_ctx = ctx();
26787   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26788   auto res = isl_union_pw_multi_aff_union_add(copy(), upma2.release());
26789   if (!res)
26790     exception::throw_last_error(saved_ctx);
26791   return manage(res);
26792 }
26793 
26794 inline std::ostream &operator<<(std::ostream &os, const union_pw_multi_aff &obj)
26795 {
26796   if (!obj.get())
26797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26798   auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.get());
26799   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26800   char *str = isl_union_pw_multi_aff_to_str(obj.get());
26801   if (!str)
26802     exception::throw_last_error(saved_ctx);
26803   os << str;
26804   free(str);
26805   return os;
26806 }
26807 
26808 // implementations for isl::union_set
manage(__isl_take isl_union_set * ptr)26809 union_set manage(__isl_take isl_union_set *ptr) {
26810   if (!ptr)
26811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26812   return union_set(ptr);
26813 }
manage_copy(__isl_keep isl_union_set * ptr)26814 union_set manage_copy(__isl_keep isl_union_set *ptr) {
26815   if (!ptr)
26816     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26817   auto saved_ctx = isl_union_set_get_ctx(ptr);
26818   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26819   ptr = isl_union_set_copy(ptr);
26820   if (!ptr)
26821     exception::throw_last_error(saved_ctx);
26822   return union_set(ptr);
26823 }
26824 
union_set()26825 union_set::union_set()
26826     : ptr(nullptr) {}
26827 
union_set(const union_set & obj)26828 union_set::union_set(const union_set &obj)
26829     : ptr(nullptr)
26830 {
26831   if (!obj.ptr)
26832     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26833   auto saved_ctx = isl_union_set_get_ctx(obj.ptr);
26834   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26835   ptr = obj.copy();
26836   if (!ptr)
26837     exception::throw_last_error(saved_ctx);
26838 }
26839 
union_set(__isl_take isl_union_set * ptr)26840 union_set::union_set(__isl_take isl_union_set *ptr)
26841     : ptr(ptr) {}
26842 
union_set(isl::basic_set bset)26843 union_set::union_set(isl::basic_set bset)
26844 {
26845   if (bset.is_null())
26846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26847   auto saved_ctx = bset.ctx();
26848   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26849   auto res = isl_union_set_from_basic_set(bset.release());
26850   if (!res)
26851     exception::throw_last_error(saved_ctx);
26852   ptr = res;
26853 }
26854 
union_set(isl::point pnt)26855 union_set::union_set(isl::point pnt)
26856 {
26857   if (pnt.is_null())
26858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26859   auto saved_ctx = pnt.ctx();
26860   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26861   auto res = isl_union_set_from_point(pnt.release());
26862   if (!res)
26863     exception::throw_last_error(saved_ctx);
26864   ptr = res;
26865 }
26866 
union_set(isl::set set)26867 union_set::union_set(isl::set set)
26868 {
26869   if (set.is_null())
26870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26871   auto saved_ctx = set.ctx();
26872   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26873   auto res = isl_union_set_from_set(set.release());
26874   if (!res)
26875     exception::throw_last_error(saved_ctx);
26876   ptr = res;
26877 }
26878 
union_set(isl::ctx ctx,const std::string & str)26879 union_set::union_set(isl::ctx ctx, const std::string &str)
26880 {
26881   auto saved_ctx = ctx;
26882   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26883   auto res = isl_union_set_read_from_str(ctx.release(), str.c_str());
26884   if (!res)
26885     exception::throw_last_error(saved_ctx);
26886   ptr = res;
26887 }
26888 
26889 union_set &union_set::operator=(union_set obj) {
26890   std::swap(this->ptr, obj.ptr);
26891   return *this;
26892 }
26893 
~union_set()26894 union_set::~union_set() {
26895   if (ptr)
26896     isl_union_set_free(ptr);
26897 }
26898 
copy()26899 __isl_give isl_union_set *union_set::copy() const & {
26900   return isl_union_set_copy(ptr);
26901 }
26902 
get()26903 __isl_keep isl_union_set *union_set::get() const {
26904   return ptr;
26905 }
26906 
release()26907 __isl_give isl_union_set *union_set::release() {
26908   isl_union_set *tmp = ptr;
26909   ptr = nullptr;
26910   return tmp;
26911 }
26912 
is_null()26913 bool union_set::is_null() const {
26914   return ptr == nullptr;
26915 }
26916 
ctx()26917 isl::ctx union_set::ctx() const {
26918   return isl::ctx(isl_union_set_get_ctx(ptr));
26919 }
26920 
affine_hull()26921 isl::union_set union_set::affine_hull() const
26922 {
26923   if (!ptr)
26924     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26925   auto saved_ctx = ctx();
26926   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26927   auto res = isl_union_set_affine_hull(copy());
26928   if (!res)
26929     exception::throw_last_error(saved_ctx);
26930   return manage(res);
26931 }
26932 
apply(isl::union_map umap)26933 isl::union_set union_set::apply(isl::union_map umap) const
26934 {
26935   if (!ptr || umap.is_null())
26936     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26937   auto saved_ctx = ctx();
26938   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26939   auto res = isl_union_set_apply(copy(), umap.release());
26940   if (!res)
26941     exception::throw_last_error(saved_ctx);
26942   return manage(res);
26943 }
26944 
as_set()26945 isl::set union_set::as_set() const
26946 {
26947   if (!ptr)
26948     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26949   auto saved_ctx = ctx();
26950   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26951   auto res = isl_union_set_as_set(copy());
26952   if (!res)
26953     exception::throw_last_error(saved_ctx);
26954   return manage(res);
26955 }
26956 
coalesce()26957 isl::union_set union_set::coalesce() const
26958 {
26959   if (!ptr)
26960     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26961   auto saved_ctx = ctx();
26962   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26963   auto res = isl_union_set_coalesce(copy());
26964   if (!res)
26965     exception::throw_last_error(saved_ctx);
26966   return manage(res);
26967 }
26968 
compute_divs()26969 isl::union_set union_set::compute_divs() const
26970 {
26971   if (!ptr)
26972     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26973   auto saved_ctx = ctx();
26974   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26975   auto res = isl_union_set_compute_divs(copy());
26976   if (!res)
26977     exception::throw_last_error(saved_ctx);
26978   return manage(res);
26979 }
26980 
detect_equalities()26981 isl::union_set union_set::detect_equalities() const
26982 {
26983   if (!ptr)
26984     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26985   auto saved_ctx = ctx();
26986   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26987   auto res = isl_union_set_detect_equalities(copy());
26988   if (!res)
26989     exception::throw_last_error(saved_ctx);
26990   return manage(res);
26991 }
26992 
empty(isl::ctx ctx)26993 isl::union_set union_set::empty(isl::ctx ctx)
26994 {
26995   auto saved_ctx = ctx;
26996   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26997   auto res = isl_union_set_empty_ctx(ctx.release());
26998   if (!res)
26999     exception::throw_last_error(saved_ctx);
27000   return manage(res);
27001 }
27002 
every_set(const std::function<bool (isl::set)> & test)27003 bool union_set::every_set(const std::function<bool(isl::set)> &test) const
27004 {
27005   if (!ptr)
27006     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27007   auto saved_ctx = ctx();
27008   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27009   struct test_data {
27010     std::function<bool(isl::set)> func;
27011     std::exception_ptr eptr;
27012   } test_data = { test };
27013   auto test_lambda = [](isl_set *arg_0, void *arg_1) -> isl_bool {
27014     auto *data = static_cast<struct test_data *>(arg_1);
27015     ISL_CPP_TRY {
27016       auto ret = (data->func)(manage_copy(arg_0));
27017       return ret ? isl_bool_true : isl_bool_false;
27018     } ISL_CPP_CATCH_ALL {
27019       data->eptr = std::current_exception();
27020       return isl_bool_error;
27021     }
27022   };
27023   auto res = isl_union_set_every_set(get(), test_lambda, &test_data);
27024   if (test_data.eptr)
27025     std::rethrow_exception(test_data.eptr);
27026   if (res < 0)
27027     exception::throw_last_error(saved_ctx);
27028   return res;
27029 }
27030 
extract_set(isl::space space)27031 isl::set union_set::extract_set(isl::space space) const
27032 {
27033   if (!ptr || space.is_null())
27034     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27035   auto saved_ctx = ctx();
27036   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27037   auto res = isl_union_set_extract_set(get(), space.release());
27038   if (!res)
27039     exception::throw_last_error(saved_ctx);
27040   return manage(res);
27041 }
27042 
foreach_point(const std::function<void (isl::point)> & fn)27043 void union_set::foreach_point(const std::function<void(isl::point)> &fn) const
27044 {
27045   if (!ptr)
27046     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27047   auto saved_ctx = ctx();
27048   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27049   struct fn_data {
27050     std::function<void(isl::point)> func;
27051     std::exception_ptr eptr;
27052   } fn_data = { fn };
27053   auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
27054     auto *data = static_cast<struct fn_data *>(arg_1);
27055     ISL_CPP_TRY {
27056       (data->func)(manage(arg_0));
27057       return isl_stat_ok;
27058     } ISL_CPP_CATCH_ALL {
27059       data->eptr = std::current_exception();
27060       return isl_stat_error;
27061     }
27062   };
27063   auto res = isl_union_set_foreach_point(get(), fn_lambda, &fn_data);
27064   if (fn_data.eptr)
27065     std::rethrow_exception(fn_data.eptr);
27066   if (res < 0)
27067     exception::throw_last_error(saved_ctx);
27068   return;
27069 }
27070 
foreach_set(const std::function<void (isl::set)> & fn)27071 void union_set::foreach_set(const std::function<void(isl::set)> &fn) const
27072 {
27073   if (!ptr)
27074     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27075   auto saved_ctx = ctx();
27076   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27077   struct fn_data {
27078     std::function<void(isl::set)> func;
27079     std::exception_ptr eptr;
27080   } fn_data = { fn };
27081   auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
27082     auto *data = static_cast<struct fn_data *>(arg_1);
27083     ISL_CPP_TRY {
27084       (data->func)(manage(arg_0));
27085       return isl_stat_ok;
27086     } ISL_CPP_CATCH_ALL {
27087       data->eptr = std::current_exception();
27088       return isl_stat_error;
27089     }
27090   };
27091   auto res = isl_union_set_foreach_set(get(), fn_lambda, &fn_data);
27092   if (fn_data.eptr)
27093     std::rethrow_exception(fn_data.eptr);
27094   if (res < 0)
27095     exception::throw_last_error(saved_ctx);
27096   return;
27097 }
27098 
gist(isl::union_set context)27099 isl::union_set union_set::gist(isl::union_set context) const
27100 {
27101   if (!ptr || context.is_null())
27102     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27103   auto saved_ctx = ctx();
27104   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27105   auto res = isl_union_set_gist(copy(), context.release());
27106   if (!res)
27107     exception::throw_last_error(saved_ctx);
27108   return manage(res);
27109 }
27110 
gist_params(isl::set set)27111 isl::union_set union_set::gist_params(isl::set set) const
27112 {
27113   if (!ptr || set.is_null())
27114     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27115   auto saved_ctx = ctx();
27116   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27117   auto res = isl_union_set_gist_params(copy(), set.release());
27118   if (!res)
27119     exception::throw_last_error(saved_ctx);
27120   return manage(res);
27121 }
27122 
identity()27123 isl::union_map union_set::identity() const
27124 {
27125   if (!ptr)
27126     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27127   auto saved_ctx = ctx();
27128   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27129   auto res = isl_union_set_identity(copy());
27130   if (!res)
27131     exception::throw_last_error(saved_ctx);
27132   return manage(res);
27133 }
27134 
intersect(isl::union_set uset2)27135 isl::union_set union_set::intersect(isl::union_set uset2) const
27136 {
27137   if (!ptr || uset2.is_null())
27138     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27139   auto saved_ctx = ctx();
27140   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27141   auto res = isl_union_set_intersect(copy(), uset2.release());
27142   if (!res)
27143     exception::throw_last_error(saved_ctx);
27144   return manage(res);
27145 }
27146 
intersect_params(isl::set set)27147 isl::union_set union_set::intersect_params(isl::set set) const
27148 {
27149   if (!ptr || set.is_null())
27150     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27151   auto saved_ctx = ctx();
27152   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27153   auto res = isl_union_set_intersect_params(copy(), set.release());
27154   if (!res)
27155     exception::throw_last_error(saved_ctx);
27156   return manage(res);
27157 }
27158 
is_disjoint(const isl::union_set & uset2)27159 bool union_set::is_disjoint(const isl::union_set &uset2) const
27160 {
27161   if (!ptr || uset2.is_null())
27162     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27163   auto saved_ctx = ctx();
27164   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27165   auto res = isl_union_set_is_disjoint(get(), uset2.get());
27166   if (res < 0)
27167     exception::throw_last_error(saved_ctx);
27168   return res;
27169 }
27170 
is_empty()27171 bool union_set::is_empty() const
27172 {
27173   if (!ptr)
27174     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27175   auto saved_ctx = ctx();
27176   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27177   auto res = isl_union_set_is_empty(get());
27178   if (res < 0)
27179     exception::throw_last_error(saved_ctx);
27180   return res;
27181 }
27182 
is_equal(const isl::union_set & uset2)27183 bool union_set::is_equal(const isl::union_set &uset2) const
27184 {
27185   if (!ptr || uset2.is_null())
27186     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27187   auto saved_ctx = ctx();
27188   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27189   auto res = isl_union_set_is_equal(get(), uset2.get());
27190   if (res < 0)
27191     exception::throw_last_error(saved_ctx);
27192   return res;
27193 }
27194 
is_strict_subset(const isl::union_set & uset2)27195 bool union_set::is_strict_subset(const isl::union_set &uset2) const
27196 {
27197   if (!ptr || uset2.is_null())
27198     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27199   auto saved_ctx = ctx();
27200   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27201   auto res = isl_union_set_is_strict_subset(get(), uset2.get());
27202   if (res < 0)
27203     exception::throw_last_error(saved_ctx);
27204   return res;
27205 }
27206 
is_subset(const isl::union_set & uset2)27207 bool union_set::is_subset(const isl::union_set &uset2) const
27208 {
27209   if (!ptr || uset2.is_null())
27210     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27211   auto saved_ctx = ctx();
27212   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27213   auto res = isl_union_set_is_subset(get(), uset2.get());
27214   if (res < 0)
27215     exception::throw_last_error(saved_ctx);
27216   return res;
27217 }
27218 
isa_set()27219 bool union_set::isa_set() const
27220 {
27221   if (!ptr)
27222     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27223   auto saved_ctx = ctx();
27224   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27225   auto res = isl_union_set_isa_set(get());
27226   if (res < 0)
27227     exception::throw_last_error(saved_ctx);
27228   return res;
27229 }
27230 
lexmax()27231 isl::union_set union_set::lexmax() const
27232 {
27233   if (!ptr)
27234     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27235   auto saved_ctx = ctx();
27236   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27237   auto res = isl_union_set_lexmax(copy());
27238   if (!res)
27239     exception::throw_last_error(saved_ctx);
27240   return manage(res);
27241 }
27242 
lexmin()27243 isl::union_set union_set::lexmin() const
27244 {
27245   if (!ptr)
27246     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27247   auto saved_ctx = ctx();
27248   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27249   auto res = isl_union_set_lexmin(copy());
27250   if (!res)
27251     exception::throw_last_error(saved_ctx);
27252   return manage(res);
27253 }
27254 
polyhedral_hull()27255 isl::union_set union_set::polyhedral_hull() const
27256 {
27257   if (!ptr)
27258     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27259   auto saved_ctx = ctx();
27260   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27261   auto res = isl_union_set_polyhedral_hull(copy());
27262   if (!res)
27263     exception::throw_last_error(saved_ctx);
27264   return manage(res);
27265 }
27266 
preimage(isl::multi_aff ma)27267 isl::union_set union_set::preimage(isl::multi_aff ma) const
27268 {
27269   if (!ptr || ma.is_null())
27270     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27271   auto saved_ctx = ctx();
27272   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27273   auto res = isl_union_set_preimage_multi_aff(copy(), ma.release());
27274   if (!res)
27275     exception::throw_last_error(saved_ctx);
27276   return manage(res);
27277 }
27278 
preimage(isl::pw_multi_aff pma)27279 isl::union_set union_set::preimage(isl::pw_multi_aff pma) const
27280 {
27281   if (!ptr || pma.is_null())
27282     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27283   auto saved_ctx = ctx();
27284   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27285   auto res = isl_union_set_preimage_pw_multi_aff(copy(), pma.release());
27286   if (!res)
27287     exception::throw_last_error(saved_ctx);
27288   return manage(res);
27289 }
27290 
preimage(isl::union_pw_multi_aff upma)27291 isl::union_set union_set::preimage(isl::union_pw_multi_aff upma) const
27292 {
27293   if (!ptr || upma.is_null())
27294     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27295   auto saved_ctx = ctx();
27296   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27297   auto res = isl_union_set_preimage_union_pw_multi_aff(copy(), upma.release());
27298   if (!res)
27299     exception::throw_last_error(saved_ctx);
27300   return manage(res);
27301 }
27302 
sample_point()27303 isl::point union_set::sample_point() const
27304 {
27305   if (!ptr)
27306     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27307   auto saved_ctx = ctx();
27308   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27309   auto res = isl_union_set_sample_point(copy());
27310   if (!res)
27311     exception::throw_last_error(saved_ctx);
27312   return manage(res);
27313 }
27314 
set_list()27315 isl::set_list union_set::set_list() const
27316 {
27317   if (!ptr)
27318     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27319   auto saved_ctx = ctx();
27320   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27321   auto res = isl_union_set_get_set_list(get());
27322   if (!res)
27323     exception::throw_last_error(saved_ctx);
27324   return manage(res);
27325 }
27326 
get_set_list()27327 isl::set_list union_set::get_set_list() const
27328 {
27329   return set_list();
27330 }
27331 
space()27332 isl::space union_set::space() const
27333 {
27334   if (!ptr)
27335     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27336   auto saved_ctx = ctx();
27337   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27338   auto res = isl_union_set_get_space(get());
27339   if (!res)
27340     exception::throw_last_error(saved_ctx);
27341   return manage(res);
27342 }
27343 
get_space()27344 isl::space union_set::get_space() const
27345 {
27346   return space();
27347 }
27348 
subtract(isl::union_set uset2)27349 isl::union_set union_set::subtract(isl::union_set uset2) const
27350 {
27351   if (!ptr || uset2.is_null())
27352     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27353   auto saved_ctx = ctx();
27354   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27355   auto res = isl_union_set_subtract(copy(), uset2.release());
27356   if (!res)
27357     exception::throw_last_error(saved_ctx);
27358   return manage(res);
27359 }
27360 
to_list()27361 isl::union_set_list union_set::to_list() const
27362 {
27363   if (!ptr)
27364     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27365   auto saved_ctx = ctx();
27366   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27367   auto res = isl_union_set_to_list(copy());
27368   if (!res)
27369     exception::throw_last_error(saved_ctx);
27370   return manage(res);
27371 }
27372 
unite(isl::union_set uset2)27373 isl::union_set union_set::unite(isl::union_set uset2) const
27374 {
27375   if (!ptr || uset2.is_null())
27376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27377   auto saved_ctx = ctx();
27378   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27379   auto res = isl_union_set_union(copy(), uset2.release());
27380   if (!res)
27381     exception::throw_last_error(saved_ctx);
27382   return manage(res);
27383 }
27384 
universe()27385 isl::union_set union_set::universe() const
27386 {
27387   if (!ptr)
27388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27389   auto saved_ctx = ctx();
27390   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27391   auto res = isl_union_set_universe(copy());
27392   if (!res)
27393     exception::throw_last_error(saved_ctx);
27394   return manage(res);
27395 }
27396 
unwrap()27397 isl::union_map union_set::unwrap() const
27398 {
27399   if (!ptr)
27400     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27401   auto saved_ctx = ctx();
27402   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27403   auto res = isl_union_set_unwrap(copy());
27404   if (!res)
27405     exception::throw_last_error(saved_ctx);
27406   return manage(res);
27407 }
27408 
27409 inline std::ostream &operator<<(std::ostream &os, const union_set &obj)
27410 {
27411   if (!obj.get())
27412     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27413   auto saved_ctx = isl_union_set_get_ctx(obj.get());
27414   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27415   char *str = isl_union_set_to_str(obj.get());
27416   if (!str)
27417     exception::throw_last_error(saved_ctx);
27418   os << str;
27419   free(str);
27420   return os;
27421 }
27422 
27423 // implementations for isl::union_set_list
manage(__isl_take isl_union_set_list * ptr)27424 union_set_list manage(__isl_take isl_union_set_list *ptr) {
27425   if (!ptr)
27426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27427   return union_set_list(ptr);
27428 }
manage_copy(__isl_keep isl_union_set_list * ptr)27429 union_set_list manage_copy(__isl_keep isl_union_set_list *ptr) {
27430   if (!ptr)
27431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27432   auto saved_ctx = isl_union_set_list_get_ctx(ptr);
27433   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27434   ptr = isl_union_set_list_copy(ptr);
27435   if (!ptr)
27436     exception::throw_last_error(saved_ctx);
27437   return union_set_list(ptr);
27438 }
27439 
union_set_list()27440 union_set_list::union_set_list()
27441     : ptr(nullptr) {}
27442 
union_set_list(const union_set_list & obj)27443 union_set_list::union_set_list(const union_set_list &obj)
27444     : ptr(nullptr)
27445 {
27446   if (!obj.ptr)
27447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27448   auto saved_ctx = isl_union_set_list_get_ctx(obj.ptr);
27449   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27450   ptr = obj.copy();
27451   if (!ptr)
27452     exception::throw_last_error(saved_ctx);
27453 }
27454 
union_set_list(__isl_take isl_union_set_list * ptr)27455 union_set_list::union_set_list(__isl_take isl_union_set_list *ptr)
27456     : ptr(ptr) {}
27457 
union_set_list(isl::ctx ctx,int n)27458 union_set_list::union_set_list(isl::ctx ctx, int n)
27459 {
27460   auto saved_ctx = ctx;
27461   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27462   auto res = isl_union_set_list_alloc(ctx.release(), n);
27463   if (!res)
27464     exception::throw_last_error(saved_ctx);
27465   ptr = res;
27466 }
27467 
union_set_list(isl::union_set el)27468 union_set_list::union_set_list(isl::union_set el)
27469 {
27470   if (el.is_null())
27471     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27472   auto saved_ctx = el.ctx();
27473   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27474   auto res = isl_union_set_list_from_union_set(el.release());
27475   if (!res)
27476     exception::throw_last_error(saved_ctx);
27477   ptr = res;
27478 }
27479 
union_set_list(isl::ctx ctx,const std::string & str)27480 union_set_list::union_set_list(isl::ctx ctx, const std::string &str)
27481 {
27482   auto saved_ctx = ctx;
27483   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27484   auto res = isl_union_set_list_read_from_str(ctx.release(), str.c_str());
27485   if (!res)
27486     exception::throw_last_error(saved_ctx);
27487   ptr = res;
27488 }
27489 
27490 union_set_list &union_set_list::operator=(union_set_list obj) {
27491   std::swap(this->ptr, obj.ptr);
27492   return *this;
27493 }
27494 
~union_set_list()27495 union_set_list::~union_set_list() {
27496   if (ptr)
27497     isl_union_set_list_free(ptr);
27498 }
27499 
copy()27500 __isl_give isl_union_set_list *union_set_list::copy() const & {
27501   return isl_union_set_list_copy(ptr);
27502 }
27503 
get()27504 __isl_keep isl_union_set_list *union_set_list::get() const {
27505   return ptr;
27506 }
27507 
release()27508 __isl_give isl_union_set_list *union_set_list::release() {
27509   isl_union_set_list *tmp = ptr;
27510   ptr = nullptr;
27511   return tmp;
27512 }
27513 
is_null()27514 bool union_set_list::is_null() const {
27515   return ptr == nullptr;
27516 }
27517 
ctx()27518 isl::ctx union_set_list::ctx() const {
27519   return isl::ctx(isl_union_set_list_get_ctx(ptr));
27520 }
27521 
add(isl::union_set el)27522 isl::union_set_list union_set_list::add(isl::union_set el) const
27523 {
27524   if (!ptr || el.is_null())
27525     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27526   auto saved_ctx = ctx();
27527   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27528   auto res = isl_union_set_list_add(copy(), el.release());
27529   if (!res)
27530     exception::throw_last_error(saved_ctx);
27531   return manage(res);
27532 }
27533 
at(int index)27534 isl::union_set union_set_list::at(int index) const
27535 {
27536   if (!ptr)
27537     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27538   auto saved_ctx = ctx();
27539   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27540   auto res = isl_union_set_list_get_at(get(), index);
27541   if (!res)
27542     exception::throw_last_error(saved_ctx);
27543   return manage(res);
27544 }
27545 
get_at(int index)27546 isl::union_set union_set_list::get_at(int index) const
27547 {
27548   return at(index);
27549 }
27550 
clear()27551 isl::union_set_list union_set_list::clear() const
27552 {
27553   if (!ptr)
27554     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27555   auto saved_ctx = ctx();
27556   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27557   auto res = isl_union_set_list_clear(copy());
27558   if (!res)
27559     exception::throw_last_error(saved_ctx);
27560   return manage(res);
27561 }
27562 
concat(isl::union_set_list list2)27563 isl::union_set_list union_set_list::concat(isl::union_set_list list2) const
27564 {
27565   if (!ptr || list2.is_null())
27566     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27567   auto saved_ctx = ctx();
27568   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27569   auto res = isl_union_set_list_concat(copy(), list2.release());
27570   if (!res)
27571     exception::throw_last_error(saved_ctx);
27572   return manage(res);
27573 }
27574 
drop(unsigned int first,unsigned int n)27575 isl::union_set_list union_set_list::drop(unsigned int first, unsigned int n) const
27576 {
27577   if (!ptr)
27578     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27579   auto saved_ctx = ctx();
27580   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27581   auto res = isl_union_set_list_drop(copy(), first, n);
27582   if (!res)
27583     exception::throw_last_error(saved_ctx);
27584   return manage(res);
27585 }
27586 
foreach(const std::function<void (isl::union_set)> & fn)27587 void union_set_list::foreach(const std::function<void(isl::union_set)> &fn) const
27588 {
27589   if (!ptr)
27590     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27591   auto saved_ctx = ctx();
27592   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27593   struct fn_data {
27594     std::function<void(isl::union_set)> func;
27595     std::exception_ptr eptr;
27596   } fn_data = { fn };
27597   auto fn_lambda = [](isl_union_set *arg_0, void *arg_1) -> isl_stat {
27598     auto *data = static_cast<struct fn_data *>(arg_1);
27599     ISL_CPP_TRY {
27600       (data->func)(manage(arg_0));
27601       return isl_stat_ok;
27602     } ISL_CPP_CATCH_ALL {
27603       data->eptr = std::current_exception();
27604       return isl_stat_error;
27605     }
27606   };
27607   auto res = isl_union_set_list_foreach(get(), fn_lambda, &fn_data);
27608   if (fn_data.eptr)
27609     std::rethrow_exception(fn_data.eptr);
27610   if (res < 0)
27611     exception::throw_last_error(saved_ctx);
27612   return;
27613 }
27614 
insert(unsigned int pos,isl::union_set el)27615 isl::union_set_list union_set_list::insert(unsigned int pos, isl::union_set el) const
27616 {
27617   if (!ptr || el.is_null())
27618     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27619   auto saved_ctx = ctx();
27620   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27621   auto res = isl_union_set_list_insert(copy(), pos, el.release());
27622   if (!res)
27623     exception::throw_last_error(saved_ctx);
27624   return manage(res);
27625 }
27626 
size()27627 unsigned union_set_list::size() const
27628 {
27629   if (!ptr)
27630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27631   auto saved_ctx = ctx();
27632   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27633   auto res = isl_union_set_list_size(get());
27634   if (res < 0)
27635     exception::throw_last_error(saved_ctx);
27636   return res;
27637 }
27638 
27639 inline std::ostream &operator<<(std::ostream &os, const union_set_list &obj)
27640 {
27641   if (!obj.get())
27642     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27643   auto saved_ctx = isl_union_set_list_get_ctx(obj.get());
27644   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27645   char *str = isl_union_set_list_to_str(obj.get());
27646   if (!str)
27647     exception::throw_last_error(saved_ctx);
27648   os << str;
27649   free(str);
27650   return os;
27651 }
27652 
27653 // implementations for isl::val
manage(__isl_take isl_val * ptr)27654 val manage(__isl_take isl_val *ptr) {
27655   if (!ptr)
27656     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27657   return val(ptr);
27658 }
manage_copy(__isl_keep isl_val * ptr)27659 val manage_copy(__isl_keep isl_val *ptr) {
27660   if (!ptr)
27661     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27662   auto saved_ctx = isl_val_get_ctx(ptr);
27663   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27664   ptr = isl_val_copy(ptr);
27665   if (!ptr)
27666     exception::throw_last_error(saved_ctx);
27667   return val(ptr);
27668 }
27669 
val()27670 val::val()
27671     : ptr(nullptr) {}
27672 
val(const val & obj)27673 val::val(const val &obj)
27674     : ptr(nullptr)
27675 {
27676   if (!obj.ptr)
27677     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27678   auto saved_ctx = isl_val_get_ctx(obj.ptr);
27679   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27680   ptr = obj.copy();
27681   if (!ptr)
27682     exception::throw_last_error(saved_ctx);
27683 }
27684 
val(__isl_take isl_val * ptr)27685 val::val(__isl_take isl_val *ptr)
27686     : ptr(ptr) {}
27687 
val(isl::ctx ctx,long i)27688 val::val(isl::ctx ctx, long i)
27689 {
27690   auto saved_ctx = ctx;
27691   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27692   auto res = isl_val_int_from_si(ctx.release(), i);
27693   if (!res)
27694     exception::throw_last_error(saved_ctx);
27695   ptr = res;
27696 }
27697 
val(isl::ctx ctx,const std::string & str)27698 val::val(isl::ctx ctx, const std::string &str)
27699 {
27700   auto saved_ctx = ctx;
27701   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27702   auto res = isl_val_read_from_str(ctx.release(), str.c_str());
27703   if (!res)
27704     exception::throw_last_error(saved_ctx);
27705   ptr = res;
27706 }
27707 
27708 val &val::operator=(val obj) {
27709   std::swap(this->ptr, obj.ptr);
27710   return *this;
27711 }
27712 
~val()27713 val::~val() {
27714   if (ptr)
27715     isl_val_free(ptr);
27716 }
27717 
copy()27718 __isl_give isl_val *val::copy() const & {
27719   return isl_val_copy(ptr);
27720 }
27721 
get()27722 __isl_keep isl_val *val::get() const {
27723   return ptr;
27724 }
27725 
release()27726 __isl_give isl_val *val::release() {
27727   isl_val *tmp = ptr;
27728   ptr = nullptr;
27729   return tmp;
27730 }
27731 
is_null()27732 bool val::is_null() const {
27733   return ptr == nullptr;
27734 }
27735 
ctx()27736 isl::ctx val::ctx() const {
27737   return isl::ctx(isl_val_get_ctx(ptr));
27738 }
27739 
abs()27740 isl::val val::abs() const
27741 {
27742   if (!ptr)
27743     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27744   auto saved_ctx = ctx();
27745   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27746   auto res = isl_val_abs(copy());
27747   if (!res)
27748     exception::throw_last_error(saved_ctx);
27749   return manage(res);
27750 }
27751 
abs_eq(const isl::val & v2)27752 bool val::abs_eq(const isl::val &v2) const
27753 {
27754   if (!ptr || v2.is_null())
27755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27756   auto saved_ctx = ctx();
27757   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27758   auto res = isl_val_abs_eq(get(), v2.get());
27759   if (res < 0)
27760     exception::throw_last_error(saved_ctx);
27761   return res;
27762 }
27763 
abs_eq(long v2)27764 bool val::abs_eq(long v2) const
27765 {
27766   if (!ptr)
27767     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27768   return this->abs_eq(isl::val(ctx(), v2));
27769 }
27770 
add(isl::val v2)27771 isl::val val::add(isl::val v2) const
27772 {
27773   if (!ptr || v2.is_null())
27774     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27775   auto saved_ctx = ctx();
27776   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27777   auto res = isl_val_add(copy(), v2.release());
27778   if (!res)
27779     exception::throw_last_error(saved_ctx);
27780   return manage(res);
27781 }
27782 
add(long v2)27783 isl::val val::add(long v2) const
27784 {
27785   if (!ptr)
27786     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27787   return this->add(isl::val(ctx(), v2));
27788 }
27789 
ceil()27790 isl::val val::ceil() const
27791 {
27792   if (!ptr)
27793     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27794   auto saved_ctx = ctx();
27795   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27796   auto res = isl_val_ceil(copy());
27797   if (!res)
27798     exception::throw_last_error(saved_ctx);
27799   return manage(res);
27800 }
27801 
cmp_si(long i)27802 int val::cmp_si(long i) const
27803 {
27804   if (!ptr)
27805     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27806   auto saved_ctx = ctx();
27807   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27808   auto res = isl_val_cmp_si(get(), i);
27809   return res;
27810 }
27811 
den_si()27812 long val::den_si() const
27813 {
27814   if (!ptr)
27815     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27816   auto saved_ctx = ctx();
27817   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27818   auto res = isl_val_get_den_si(get());
27819   return res;
27820 }
27821 
get_den_si()27822 long val::get_den_si() const
27823 {
27824   return den_si();
27825 }
27826 
div(isl::val v2)27827 isl::val val::div(isl::val v2) const
27828 {
27829   if (!ptr || v2.is_null())
27830     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27831   auto saved_ctx = ctx();
27832   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27833   auto res = isl_val_div(copy(), v2.release());
27834   if (!res)
27835     exception::throw_last_error(saved_ctx);
27836   return manage(res);
27837 }
27838 
div(long v2)27839 isl::val val::div(long v2) const
27840 {
27841   if (!ptr)
27842     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27843   return this->div(isl::val(ctx(), v2));
27844 }
27845 
eq(const isl::val & v2)27846 bool val::eq(const isl::val &v2) const
27847 {
27848   if (!ptr || v2.is_null())
27849     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27850   auto saved_ctx = ctx();
27851   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27852   auto res = isl_val_eq(get(), v2.get());
27853   if (res < 0)
27854     exception::throw_last_error(saved_ctx);
27855   return res;
27856 }
27857 
eq(long v2)27858 bool val::eq(long v2) const
27859 {
27860   if (!ptr)
27861     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27862   return this->eq(isl::val(ctx(), v2));
27863 }
27864 
floor()27865 isl::val val::floor() const
27866 {
27867   if (!ptr)
27868     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27869   auto saved_ctx = ctx();
27870   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27871   auto res = isl_val_floor(copy());
27872   if (!res)
27873     exception::throw_last_error(saved_ctx);
27874   return manage(res);
27875 }
27876 
gcd(isl::val v2)27877 isl::val val::gcd(isl::val v2) const
27878 {
27879   if (!ptr || v2.is_null())
27880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27881   auto saved_ctx = ctx();
27882   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27883   auto res = isl_val_gcd(copy(), v2.release());
27884   if (!res)
27885     exception::throw_last_error(saved_ctx);
27886   return manage(res);
27887 }
27888 
gcd(long v2)27889 isl::val val::gcd(long v2) const
27890 {
27891   if (!ptr)
27892     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27893   return this->gcd(isl::val(ctx(), v2));
27894 }
27895 
ge(const isl::val & v2)27896 bool val::ge(const isl::val &v2) const
27897 {
27898   if (!ptr || v2.is_null())
27899     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27900   auto saved_ctx = ctx();
27901   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27902   auto res = isl_val_ge(get(), v2.get());
27903   if (res < 0)
27904     exception::throw_last_error(saved_ctx);
27905   return res;
27906 }
27907 
ge(long v2)27908 bool val::ge(long v2) const
27909 {
27910   if (!ptr)
27911     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27912   return this->ge(isl::val(ctx(), v2));
27913 }
27914 
gt(const isl::val & v2)27915 bool val::gt(const isl::val &v2) const
27916 {
27917   if (!ptr || v2.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_val_gt(get(), v2.get());
27922   if (res < 0)
27923     exception::throw_last_error(saved_ctx);
27924   return res;
27925 }
27926 
gt(long v2)27927 bool val::gt(long v2) const
27928 {
27929   if (!ptr)
27930     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27931   return this->gt(isl::val(ctx(), v2));
27932 }
27933 
infty(isl::ctx ctx)27934 isl::val val::infty(isl::ctx ctx)
27935 {
27936   auto saved_ctx = ctx;
27937   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27938   auto res = isl_val_infty(ctx.release());
27939   if (!res)
27940     exception::throw_last_error(saved_ctx);
27941   return manage(res);
27942 }
27943 
inv()27944 isl::val val::inv() const
27945 {
27946   if (!ptr)
27947     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27948   auto saved_ctx = ctx();
27949   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27950   auto res = isl_val_inv(copy());
27951   if (!res)
27952     exception::throw_last_error(saved_ctx);
27953   return manage(res);
27954 }
27955 
is_divisible_by(const isl::val & v2)27956 bool val::is_divisible_by(const isl::val &v2) const
27957 {
27958   if (!ptr || v2.is_null())
27959     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27960   auto saved_ctx = ctx();
27961   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27962   auto res = isl_val_is_divisible_by(get(), v2.get());
27963   if (res < 0)
27964     exception::throw_last_error(saved_ctx);
27965   return res;
27966 }
27967 
is_divisible_by(long v2)27968 bool val::is_divisible_by(long v2) const
27969 {
27970   if (!ptr)
27971     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27972   return this->is_divisible_by(isl::val(ctx(), v2));
27973 }
27974 
is_infty()27975 bool val::is_infty() const
27976 {
27977   if (!ptr)
27978     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27979   auto saved_ctx = ctx();
27980   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27981   auto res = isl_val_is_infty(get());
27982   if (res < 0)
27983     exception::throw_last_error(saved_ctx);
27984   return res;
27985 }
27986 
is_int()27987 bool val::is_int() const
27988 {
27989   if (!ptr)
27990     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27991   auto saved_ctx = ctx();
27992   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27993   auto res = isl_val_is_int(get());
27994   if (res < 0)
27995     exception::throw_last_error(saved_ctx);
27996   return res;
27997 }
27998 
is_nan()27999 bool val::is_nan() const
28000 {
28001   if (!ptr)
28002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28003   auto saved_ctx = ctx();
28004   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28005   auto res = isl_val_is_nan(get());
28006   if (res < 0)
28007     exception::throw_last_error(saved_ctx);
28008   return res;
28009 }
28010 
is_neg()28011 bool val::is_neg() const
28012 {
28013   if (!ptr)
28014     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28015   auto saved_ctx = ctx();
28016   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28017   auto res = isl_val_is_neg(get());
28018   if (res < 0)
28019     exception::throw_last_error(saved_ctx);
28020   return res;
28021 }
28022 
is_neginfty()28023 bool val::is_neginfty() const
28024 {
28025   if (!ptr)
28026     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28027   auto saved_ctx = ctx();
28028   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28029   auto res = isl_val_is_neginfty(get());
28030   if (res < 0)
28031     exception::throw_last_error(saved_ctx);
28032   return res;
28033 }
28034 
is_negone()28035 bool val::is_negone() const
28036 {
28037   if (!ptr)
28038     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28039   auto saved_ctx = ctx();
28040   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28041   auto res = isl_val_is_negone(get());
28042   if (res < 0)
28043     exception::throw_last_error(saved_ctx);
28044   return res;
28045 }
28046 
is_nonneg()28047 bool val::is_nonneg() const
28048 {
28049   if (!ptr)
28050     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28051   auto saved_ctx = ctx();
28052   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28053   auto res = isl_val_is_nonneg(get());
28054   if (res < 0)
28055     exception::throw_last_error(saved_ctx);
28056   return res;
28057 }
28058 
is_nonpos()28059 bool val::is_nonpos() const
28060 {
28061   if (!ptr)
28062     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28063   auto saved_ctx = ctx();
28064   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28065   auto res = isl_val_is_nonpos(get());
28066   if (res < 0)
28067     exception::throw_last_error(saved_ctx);
28068   return res;
28069 }
28070 
is_one()28071 bool val::is_one() const
28072 {
28073   if (!ptr)
28074     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28075   auto saved_ctx = ctx();
28076   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28077   auto res = isl_val_is_one(get());
28078   if (res < 0)
28079     exception::throw_last_error(saved_ctx);
28080   return res;
28081 }
28082 
is_pos()28083 bool val::is_pos() const
28084 {
28085   if (!ptr)
28086     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28087   auto saved_ctx = ctx();
28088   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28089   auto res = isl_val_is_pos(get());
28090   if (res < 0)
28091     exception::throw_last_error(saved_ctx);
28092   return res;
28093 }
28094 
is_rat()28095 bool val::is_rat() const
28096 {
28097   if (!ptr)
28098     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28099   auto saved_ctx = ctx();
28100   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28101   auto res = isl_val_is_rat(get());
28102   if (res < 0)
28103     exception::throw_last_error(saved_ctx);
28104   return res;
28105 }
28106 
is_zero()28107 bool val::is_zero() const
28108 {
28109   if (!ptr)
28110     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28111   auto saved_ctx = ctx();
28112   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28113   auto res = isl_val_is_zero(get());
28114   if (res < 0)
28115     exception::throw_last_error(saved_ctx);
28116   return res;
28117 }
28118 
le(const isl::val & v2)28119 bool val::le(const isl::val &v2) const
28120 {
28121   if (!ptr || v2.is_null())
28122     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28123   auto saved_ctx = ctx();
28124   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28125   auto res = isl_val_le(get(), v2.get());
28126   if (res < 0)
28127     exception::throw_last_error(saved_ctx);
28128   return res;
28129 }
28130 
le(long v2)28131 bool val::le(long v2) const
28132 {
28133   if (!ptr)
28134     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28135   return this->le(isl::val(ctx(), v2));
28136 }
28137 
lt(const isl::val & v2)28138 bool val::lt(const isl::val &v2) const
28139 {
28140   if (!ptr || v2.is_null())
28141     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28142   auto saved_ctx = ctx();
28143   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28144   auto res = isl_val_lt(get(), v2.get());
28145   if (res < 0)
28146     exception::throw_last_error(saved_ctx);
28147   return res;
28148 }
28149 
lt(long v2)28150 bool val::lt(long v2) const
28151 {
28152   if (!ptr)
28153     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28154   return this->lt(isl::val(ctx(), v2));
28155 }
28156 
max(isl::val v2)28157 isl::val val::max(isl::val v2) const
28158 {
28159   if (!ptr || v2.is_null())
28160     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28161   auto saved_ctx = ctx();
28162   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28163   auto res = isl_val_max(copy(), v2.release());
28164   if (!res)
28165     exception::throw_last_error(saved_ctx);
28166   return manage(res);
28167 }
28168 
max(long v2)28169 isl::val val::max(long v2) const
28170 {
28171   if (!ptr)
28172     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28173   return this->max(isl::val(ctx(), v2));
28174 }
28175 
min(isl::val v2)28176 isl::val val::min(isl::val v2) const
28177 {
28178   if (!ptr || v2.is_null())
28179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28180   auto saved_ctx = ctx();
28181   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28182   auto res = isl_val_min(copy(), v2.release());
28183   if (!res)
28184     exception::throw_last_error(saved_ctx);
28185   return manage(res);
28186 }
28187 
min(long v2)28188 isl::val val::min(long v2) const
28189 {
28190   if (!ptr)
28191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28192   return this->min(isl::val(ctx(), v2));
28193 }
28194 
mod(isl::val v2)28195 isl::val val::mod(isl::val v2) const
28196 {
28197   if (!ptr || v2.is_null())
28198     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28199   auto saved_ctx = ctx();
28200   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28201   auto res = isl_val_mod(copy(), v2.release());
28202   if (!res)
28203     exception::throw_last_error(saved_ctx);
28204   return manage(res);
28205 }
28206 
mod(long v2)28207 isl::val val::mod(long v2) const
28208 {
28209   if (!ptr)
28210     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28211   return this->mod(isl::val(ctx(), v2));
28212 }
28213 
mul(isl::val v2)28214 isl::val val::mul(isl::val v2) const
28215 {
28216   if (!ptr || v2.is_null())
28217     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28218   auto saved_ctx = ctx();
28219   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28220   auto res = isl_val_mul(copy(), v2.release());
28221   if (!res)
28222     exception::throw_last_error(saved_ctx);
28223   return manage(res);
28224 }
28225 
mul(long v2)28226 isl::val val::mul(long v2) const
28227 {
28228   if (!ptr)
28229     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28230   return this->mul(isl::val(ctx(), v2));
28231 }
28232 
nan(isl::ctx ctx)28233 isl::val val::nan(isl::ctx ctx)
28234 {
28235   auto saved_ctx = ctx;
28236   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28237   auto res = isl_val_nan(ctx.release());
28238   if (!res)
28239     exception::throw_last_error(saved_ctx);
28240   return manage(res);
28241 }
28242 
ne(const isl::val & v2)28243 bool val::ne(const isl::val &v2) const
28244 {
28245   if (!ptr || v2.is_null())
28246     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28247   auto saved_ctx = ctx();
28248   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28249   auto res = isl_val_ne(get(), v2.get());
28250   if (res < 0)
28251     exception::throw_last_error(saved_ctx);
28252   return res;
28253 }
28254 
ne(long v2)28255 bool val::ne(long v2) const
28256 {
28257   if (!ptr)
28258     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28259   return this->ne(isl::val(ctx(), v2));
28260 }
28261 
neg()28262 isl::val val::neg() const
28263 {
28264   if (!ptr)
28265     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28266   auto saved_ctx = ctx();
28267   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28268   auto res = isl_val_neg(copy());
28269   if (!res)
28270     exception::throw_last_error(saved_ctx);
28271   return manage(res);
28272 }
28273 
neginfty(isl::ctx ctx)28274 isl::val val::neginfty(isl::ctx ctx)
28275 {
28276   auto saved_ctx = ctx;
28277   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28278   auto res = isl_val_neginfty(ctx.release());
28279   if (!res)
28280     exception::throw_last_error(saved_ctx);
28281   return manage(res);
28282 }
28283 
negone(isl::ctx ctx)28284 isl::val val::negone(isl::ctx ctx)
28285 {
28286   auto saved_ctx = ctx;
28287   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28288   auto res = isl_val_negone(ctx.release());
28289   if (!res)
28290     exception::throw_last_error(saved_ctx);
28291   return manage(res);
28292 }
28293 
num_si()28294 long val::num_si() const
28295 {
28296   if (!ptr)
28297     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28298   auto saved_ctx = ctx();
28299   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28300   auto res = isl_val_get_num_si(get());
28301   return res;
28302 }
28303 
get_num_si()28304 long val::get_num_si() const
28305 {
28306   return num_si();
28307 }
28308 
one(isl::ctx ctx)28309 isl::val val::one(isl::ctx ctx)
28310 {
28311   auto saved_ctx = ctx;
28312   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28313   auto res = isl_val_one(ctx.release());
28314   if (!res)
28315     exception::throw_last_error(saved_ctx);
28316   return manage(res);
28317 }
28318 
pow2()28319 isl::val val::pow2() const
28320 {
28321   if (!ptr)
28322     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28323   auto saved_ctx = ctx();
28324   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28325   auto res = isl_val_pow2(copy());
28326   if (!res)
28327     exception::throw_last_error(saved_ctx);
28328   return manage(res);
28329 }
28330 
sgn()28331 int val::sgn() const
28332 {
28333   if (!ptr)
28334     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28335   auto saved_ctx = ctx();
28336   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28337   auto res = isl_val_sgn(get());
28338   return res;
28339 }
28340 
sub(isl::val v2)28341 isl::val val::sub(isl::val v2) const
28342 {
28343   if (!ptr || v2.is_null())
28344     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28345   auto saved_ctx = ctx();
28346   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28347   auto res = isl_val_sub(copy(), v2.release());
28348   if (!res)
28349     exception::throw_last_error(saved_ctx);
28350   return manage(res);
28351 }
28352 
sub(long v2)28353 isl::val val::sub(long v2) const
28354 {
28355   if (!ptr)
28356     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28357   return this->sub(isl::val(ctx(), v2));
28358 }
28359 
to_list()28360 isl::val_list val::to_list() const
28361 {
28362   if (!ptr)
28363     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28364   auto saved_ctx = ctx();
28365   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28366   auto res = isl_val_to_list(copy());
28367   if (!res)
28368     exception::throw_last_error(saved_ctx);
28369   return manage(res);
28370 }
28371 
trunc()28372 isl::val val::trunc() const
28373 {
28374   if (!ptr)
28375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28376   auto saved_ctx = ctx();
28377   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28378   auto res = isl_val_trunc(copy());
28379   if (!res)
28380     exception::throw_last_error(saved_ctx);
28381   return manage(res);
28382 }
28383 
zero(isl::ctx ctx)28384 isl::val val::zero(isl::ctx ctx)
28385 {
28386   auto saved_ctx = ctx;
28387   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28388   auto res = isl_val_zero(ctx.release());
28389   if (!res)
28390     exception::throw_last_error(saved_ctx);
28391   return manage(res);
28392 }
28393 
28394 inline std::ostream &operator<<(std::ostream &os, const val &obj)
28395 {
28396   if (!obj.get())
28397     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28398   auto saved_ctx = isl_val_get_ctx(obj.get());
28399   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28400   char *str = isl_val_to_str(obj.get());
28401   if (!str)
28402     exception::throw_last_error(saved_ctx);
28403   os << str;
28404   free(str);
28405   return os;
28406 }
28407 
28408 // implementations for isl::val_list
manage(__isl_take isl_val_list * ptr)28409 val_list manage(__isl_take isl_val_list *ptr) {
28410   if (!ptr)
28411     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28412   return val_list(ptr);
28413 }
manage_copy(__isl_keep isl_val_list * ptr)28414 val_list manage_copy(__isl_keep isl_val_list *ptr) {
28415   if (!ptr)
28416     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28417   auto saved_ctx = isl_val_list_get_ctx(ptr);
28418   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28419   ptr = isl_val_list_copy(ptr);
28420   if (!ptr)
28421     exception::throw_last_error(saved_ctx);
28422   return val_list(ptr);
28423 }
28424 
val_list()28425 val_list::val_list()
28426     : ptr(nullptr) {}
28427 
val_list(const val_list & obj)28428 val_list::val_list(const val_list &obj)
28429     : ptr(nullptr)
28430 {
28431   if (!obj.ptr)
28432     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28433   auto saved_ctx = isl_val_list_get_ctx(obj.ptr);
28434   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28435   ptr = obj.copy();
28436   if (!ptr)
28437     exception::throw_last_error(saved_ctx);
28438 }
28439 
val_list(__isl_take isl_val_list * ptr)28440 val_list::val_list(__isl_take isl_val_list *ptr)
28441     : ptr(ptr) {}
28442 
val_list(isl::ctx ctx,int n)28443 val_list::val_list(isl::ctx ctx, int n)
28444 {
28445   auto saved_ctx = ctx;
28446   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28447   auto res = isl_val_list_alloc(ctx.release(), n);
28448   if (!res)
28449     exception::throw_last_error(saved_ctx);
28450   ptr = res;
28451 }
28452 
val_list(isl::val el)28453 val_list::val_list(isl::val el)
28454 {
28455   if (el.is_null())
28456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28457   auto saved_ctx = el.ctx();
28458   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28459   auto res = isl_val_list_from_val(el.release());
28460   if (!res)
28461     exception::throw_last_error(saved_ctx);
28462   ptr = res;
28463 }
28464 
val_list(isl::ctx ctx,const std::string & str)28465 val_list::val_list(isl::ctx ctx, const std::string &str)
28466 {
28467   auto saved_ctx = ctx;
28468   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28469   auto res = isl_val_list_read_from_str(ctx.release(), str.c_str());
28470   if (!res)
28471     exception::throw_last_error(saved_ctx);
28472   ptr = res;
28473 }
28474 
28475 val_list &val_list::operator=(val_list obj) {
28476   std::swap(this->ptr, obj.ptr);
28477   return *this;
28478 }
28479 
~val_list()28480 val_list::~val_list() {
28481   if (ptr)
28482     isl_val_list_free(ptr);
28483 }
28484 
copy()28485 __isl_give isl_val_list *val_list::copy() const & {
28486   return isl_val_list_copy(ptr);
28487 }
28488 
get()28489 __isl_keep isl_val_list *val_list::get() const {
28490   return ptr;
28491 }
28492 
release()28493 __isl_give isl_val_list *val_list::release() {
28494   isl_val_list *tmp = ptr;
28495   ptr = nullptr;
28496   return tmp;
28497 }
28498 
is_null()28499 bool val_list::is_null() const {
28500   return ptr == nullptr;
28501 }
28502 
ctx()28503 isl::ctx val_list::ctx() const {
28504   return isl::ctx(isl_val_list_get_ctx(ptr));
28505 }
28506 
add(isl::val el)28507 isl::val_list val_list::add(isl::val el) const
28508 {
28509   if (!ptr || el.is_null())
28510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28511   auto saved_ctx = ctx();
28512   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28513   auto res = isl_val_list_add(copy(), el.release());
28514   if (!res)
28515     exception::throw_last_error(saved_ctx);
28516   return manage(res);
28517 }
28518 
add(long el)28519 isl::val_list val_list::add(long el) const
28520 {
28521   if (!ptr)
28522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28523   return this->add(isl::val(ctx(), el));
28524 }
28525 
at(int index)28526 isl::val val_list::at(int index) const
28527 {
28528   if (!ptr)
28529     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28530   auto saved_ctx = ctx();
28531   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28532   auto res = isl_val_list_get_at(get(), index);
28533   if (!res)
28534     exception::throw_last_error(saved_ctx);
28535   return manage(res);
28536 }
28537 
get_at(int index)28538 isl::val val_list::get_at(int index) const
28539 {
28540   return at(index);
28541 }
28542 
clear()28543 isl::val_list val_list::clear() const
28544 {
28545   if (!ptr)
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_val_list_clear(copy());
28550   if (!res)
28551     exception::throw_last_error(saved_ctx);
28552   return manage(res);
28553 }
28554 
concat(isl::val_list list2)28555 isl::val_list val_list::concat(isl::val_list list2) const
28556 {
28557   if (!ptr || list2.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_val_list_concat(copy(), list2.release());
28562   if (!res)
28563     exception::throw_last_error(saved_ctx);
28564   return manage(res);
28565 }
28566 
drop(unsigned int first,unsigned int n)28567 isl::val_list val_list::drop(unsigned int first, unsigned int n) const
28568 {
28569   if (!ptr)
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_val_list_drop(copy(), first, n);
28574   if (!res)
28575     exception::throw_last_error(saved_ctx);
28576   return manage(res);
28577 }
28578 
foreach(const std::function<void (isl::val)> & fn)28579 void val_list::foreach(const std::function<void(isl::val)> &fn) const
28580 {
28581   if (!ptr)
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   struct fn_data {
28586     std::function<void(isl::val)> func;
28587     std::exception_ptr eptr;
28588   } fn_data = { fn };
28589   auto fn_lambda = [](isl_val *arg_0, void *arg_1) -> isl_stat {
28590     auto *data = static_cast<struct fn_data *>(arg_1);
28591     ISL_CPP_TRY {
28592       (data->func)(manage(arg_0));
28593       return isl_stat_ok;
28594     } ISL_CPP_CATCH_ALL {
28595       data->eptr = std::current_exception();
28596       return isl_stat_error;
28597     }
28598   };
28599   auto res = isl_val_list_foreach(get(), fn_lambda, &fn_data);
28600   if (fn_data.eptr)
28601     std::rethrow_exception(fn_data.eptr);
28602   if (res < 0)
28603     exception::throw_last_error(saved_ctx);
28604   return;
28605 }
28606 
insert(unsigned int pos,isl::val el)28607 isl::val_list val_list::insert(unsigned int pos, isl::val el) const
28608 {
28609   if (!ptr || el.is_null())
28610     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28611   auto saved_ctx = ctx();
28612   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28613   auto res = isl_val_list_insert(copy(), pos, el.release());
28614   if (!res)
28615     exception::throw_last_error(saved_ctx);
28616   return manage(res);
28617 }
28618 
insert(unsigned int pos,long el)28619 isl::val_list val_list::insert(unsigned int pos, long el) const
28620 {
28621   if (!ptr)
28622     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28623   return this->insert(pos, isl::val(ctx(), el));
28624 }
28625 
size()28626 unsigned val_list::size() const
28627 {
28628   if (!ptr)
28629     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28630   auto saved_ctx = ctx();
28631   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28632   auto res = isl_val_list_size(get());
28633   if (res < 0)
28634     exception::throw_last_error(saved_ctx);
28635   return res;
28636 }
28637 
28638 inline std::ostream &operator<<(std::ostream &os, const val_list &obj)
28639 {
28640   if (!obj.get())
28641     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28642   auto saved_ctx = isl_val_list_get_ctx(obj.get());
28643   options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28644   char *str = isl_val_list_to_str(obj.get());
28645   if (!str)
28646     exception::throw_last_error(saved_ctx);
28647   os << str;
28648   free(str);
28649   return os;
28650 }
28651 } // namespace isl
28652 
28653 #endif /* ISL_CPP */
28654