isl_rs/bindings/
map.rs

1// Automatically generated by isl_bindings_generator.
2// LICENSE: MIT
3
4use crate::bindings::{
5    Aff, BasicMap, Context, DimType, FixedBox, Id, PwAff, Set, Space, StrideInfo, Val,
6};
7use libc::uintptr_t;
8use std::ffi::{CStr, CString};
9use std::os::raw::c_char;
10
11/// Wraps `isl_map`.
12pub struct Map {
13    pub ptr: uintptr_t,
14    pub should_free_on_drop: bool,
15}
16
17extern "C" {
18
19    fn isl_map_domain_tuple_dim(map: uintptr_t) -> i32;
20
21    fn isl_map_range_tuple_dim(map: uintptr_t) -> i32;
22
23    fn isl_map_dim(map: uintptr_t, type_: DimType) -> i32;
24
25    fn isl_map_get_ctx(map: uintptr_t) -> uintptr_t;
26
27    fn isl_map_get_space(map: uintptr_t) -> uintptr_t;
28
29    fn isl_map_has_tuple_name(map: uintptr_t, type_: DimType) -> i32;
30
31    fn isl_map_get_tuple_name(map: uintptr_t, type_: DimType) -> *const c_char;
32
33    fn isl_map_set_tuple_name(map: uintptr_t, type_: DimType, s: *const c_char) -> uintptr_t;
34
35    fn isl_map_has_dim_name(map: uintptr_t, type_: DimType, pos: u32) -> i32;
36
37    fn isl_map_get_dim_name(map: uintptr_t, type_: DimType, pos: u32) -> *const c_char;
38
39    fn isl_map_set_dim_name(map: uintptr_t, type_: DimType, pos: u32, s: *const c_char)
40                            -> uintptr_t;
41
42    fn isl_map_set_dim_id(map: uintptr_t, type_: DimType, pos: u32, id: uintptr_t) -> uintptr_t;
43
44    fn isl_map_has_dim_id(map: uintptr_t, type_: DimType, pos: u32) -> i32;
45
46    fn isl_map_get_dim_id(map: uintptr_t, type_: DimType, pos: u32) -> uintptr_t;
47
48    fn isl_map_set_domain_tuple_id(map: uintptr_t, id: uintptr_t) -> uintptr_t;
49
50    fn isl_map_set_range_tuple_id(map: uintptr_t, id: uintptr_t) -> uintptr_t;
51
52    fn isl_map_set_tuple_id(map: uintptr_t, type_: DimType, id: uintptr_t) -> uintptr_t;
53
54    fn isl_map_reset_tuple_id(map: uintptr_t, type_: DimType) -> uintptr_t;
55
56    fn isl_map_has_domain_tuple_id(map: uintptr_t) -> i32;
57
58    fn isl_map_has_range_tuple_id(map: uintptr_t) -> i32;
59
60    fn isl_map_has_tuple_id(map: uintptr_t, type_: DimType) -> i32;
61
62    fn isl_map_get_domain_tuple_id(map: uintptr_t) -> uintptr_t;
63
64    fn isl_map_get_range_tuple_id(map: uintptr_t) -> uintptr_t;
65
66    fn isl_map_get_tuple_id(map: uintptr_t, type_: DimType) -> uintptr_t;
67
68    fn isl_map_reset_user(map: uintptr_t) -> uintptr_t;
69
70    fn isl_map_find_dim_by_id(map: uintptr_t, type_: DimType, id: uintptr_t) -> i32;
71
72    fn isl_map_find_dim_by_name(map: uintptr_t, type_: DimType, name: *const c_char) -> i32;
73
74    fn isl_map_remove_redundancies(map: uintptr_t) -> uintptr_t;
75
76    fn isl_map_simple_hull(map: uintptr_t) -> uintptr_t;
77
78    fn isl_map_unshifted_simple_hull(map: uintptr_t) -> uintptr_t;
79
80    fn isl_map_plain_unshifted_simple_hull(map: uintptr_t) -> uintptr_t;
81
82    fn isl_map_read_from_str(ctx: uintptr_t, str_: *const c_char) -> uintptr_t;
83
84    fn isl_map_dump(map: uintptr_t);
85
86    fn isl_map_to_str(map: uintptr_t) -> *const c_char;
87
88    fn isl_map_sum(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
89
90    fn isl_map_neg(map: uintptr_t) -> uintptr_t;
91
92    fn isl_map_floordiv_val(map: uintptr_t, d: uintptr_t) -> uintptr_t;
93
94    fn isl_map_lexmin(map: uintptr_t) -> uintptr_t;
95
96    fn isl_map_lexmax(map: uintptr_t) -> uintptr_t;
97
98    fn isl_map_universe(space: uintptr_t) -> uintptr_t;
99
100    fn isl_map_nat_universe(space: uintptr_t) -> uintptr_t;
101
102    fn isl_map_empty(space: uintptr_t) -> uintptr_t;
103
104    fn isl_map_identity(space: uintptr_t) -> uintptr_t;
105
106    fn isl_map_lex_lt_first(space: uintptr_t, n: u32) -> uintptr_t;
107
108    fn isl_map_lex_le_first(space: uintptr_t, n: u32) -> uintptr_t;
109
110    fn isl_map_lex_lt(set_space: uintptr_t) -> uintptr_t;
111
112    fn isl_map_lex_le(set_space: uintptr_t) -> uintptr_t;
113
114    fn isl_map_lex_gt_first(space: uintptr_t, n: u32) -> uintptr_t;
115
116    fn isl_map_lex_ge_first(space: uintptr_t, n: u32) -> uintptr_t;
117
118    fn isl_map_lex_gt(set_space: uintptr_t) -> uintptr_t;
119
120    fn isl_map_lex_ge(set_space: uintptr_t) -> uintptr_t;
121
122    fn isl_map_free(map: uintptr_t) -> uintptr_t;
123
124    fn isl_map_copy(map: uintptr_t) -> uintptr_t;
125
126    fn isl_map_reverse(map: uintptr_t) -> uintptr_t;
127
128    fn isl_map_range_reverse(map: uintptr_t) -> uintptr_t;
129
130    fn isl_map_union(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
131
132    fn isl_map_union_disjoint(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
133
134    fn isl_map_intersect_domain(map: uintptr_t, set: uintptr_t) -> uintptr_t;
135
136    fn isl_map_intersect_range(map: uintptr_t, set: uintptr_t) -> uintptr_t;
137
138    fn isl_map_intersect_domain_factor_domain(map: uintptr_t, factor: uintptr_t) -> uintptr_t;
139
140    fn isl_map_intersect_domain_factor_range(map: uintptr_t, factor: uintptr_t) -> uintptr_t;
141
142    fn isl_map_intersect_range_factor_domain(map: uintptr_t, factor: uintptr_t) -> uintptr_t;
143
144    fn isl_map_intersect_range_factor_range(map: uintptr_t, factor: uintptr_t) -> uintptr_t;
145
146    fn isl_map_intersect_domain_wrapped_domain(map: uintptr_t, domain: uintptr_t) -> uintptr_t;
147
148    fn isl_map_intersect_range_wrapped_domain(map: uintptr_t, domain: uintptr_t) -> uintptr_t;
149
150    fn isl_map_apply_domain(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
151
152    fn isl_map_apply_range(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
153
154    fn isl_map_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
155
156    fn isl_map_domain_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
157
158    fn isl_map_range_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
159
160    fn isl_map_flat_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
161
162    fn isl_map_flat_domain_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
163
164    fn isl_map_flat_range_product(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
165
166    fn isl_map_domain_is_wrapping(map: uintptr_t) -> i32;
167
168    fn isl_map_range_is_wrapping(map: uintptr_t) -> i32;
169
170    fn isl_map_is_product(map: uintptr_t) -> i32;
171
172    fn isl_map_factor_domain(map: uintptr_t) -> uintptr_t;
173
174    fn isl_map_factor_range(map: uintptr_t) -> uintptr_t;
175
176    fn isl_map_domain_factor_domain(map: uintptr_t) -> uintptr_t;
177
178    fn isl_map_domain_factor_range(map: uintptr_t) -> uintptr_t;
179
180    fn isl_map_range_factor_domain(map: uintptr_t) -> uintptr_t;
181
182    fn isl_map_range_factor_range(map: uintptr_t) -> uintptr_t;
183
184    fn isl_map_intersect(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
185
186    fn isl_map_intersect_params(map: uintptr_t, params: uintptr_t) -> uintptr_t;
187
188    fn isl_map_subtract(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
189
190    fn isl_map_subtract_domain(map: uintptr_t, dom: uintptr_t) -> uintptr_t;
191
192    fn isl_map_subtract_range(map: uintptr_t, dom: uintptr_t) -> uintptr_t;
193
194    fn isl_map_complement(map: uintptr_t) -> uintptr_t;
195
196    fn isl_map_fix_input_si(map: uintptr_t, input: u32, value: i32) -> uintptr_t;
197
198    fn isl_map_fix_si(map: uintptr_t, type_: DimType, pos: u32, value: i32) -> uintptr_t;
199
200    fn isl_map_fix_val(map: uintptr_t, type_: DimType, pos: u32, v: uintptr_t) -> uintptr_t;
201
202    fn isl_map_lower_bound_si(map: uintptr_t, type_: DimType, pos: u32, value: i32) -> uintptr_t;
203
204    fn isl_map_lower_bound_val(map: uintptr_t, type_: DimType, pos: u32, value: uintptr_t)
205                               -> uintptr_t;
206
207    fn isl_map_upper_bound_si(map: uintptr_t, type_: DimType, pos: u32, value: i32) -> uintptr_t;
208
209    fn isl_map_upper_bound_val(map: uintptr_t, type_: DimType, pos: u32, value: uintptr_t)
210                               -> uintptr_t;
211
212    fn isl_map_deltas(map: uintptr_t) -> uintptr_t;
213
214    fn isl_map_deltas_map(map: uintptr_t) -> uintptr_t;
215
216    fn isl_map_detect_equalities(map: uintptr_t) -> uintptr_t;
217
218    fn isl_map_affine_hull(map: uintptr_t) -> uintptr_t;
219
220    fn isl_map_convex_hull(map: uintptr_t) -> uintptr_t;
221
222    fn isl_map_polyhedral_hull(map: uintptr_t) -> uintptr_t;
223
224    fn isl_map_add_dims(map: uintptr_t, type_: DimType, n: u32) -> uintptr_t;
225
226    fn isl_map_insert_dims(map: uintptr_t, type_: DimType, pos: u32, n: u32) -> uintptr_t;
227
228    fn isl_map_move_dims(map: uintptr_t, dst_type: DimType, dst_pos: u32, src_type: DimType,
229                         src_pos: u32, n: u32)
230                         -> uintptr_t;
231
232    fn isl_map_project_out(map: uintptr_t, type_: DimType, first: u32, n: u32) -> uintptr_t;
233
234    fn isl_map_project_out_all_params(map: uintptr_t) -> uintptr_t;
235
236    fn isl_map_remove_unknown_divs(map: uintptr_t) -> uintptr_t;
237
238    fn isl_map_remove_divs(map: uintptr_t) -> uintptr_t;
239
240    fn isl_map_eliminate(map: uintptr_t, type_: DimType, first: u32, n: u32) -> uintptr_t;
241
242    fn isl_map_remove_dims(map: uintptr_t, type_: DimType, first: u32, n: u32) -> uintptr_t;
243
244    fn isl_map_remove_divs_involving_dims(map: uintptr_t, type_: DimType, first: u32, n: u32)
245                                          -> uintptr_t;
246
247    fn isl_map_remove_inputs(map: uintptr_t, first: u32, n: u32) -> uintptr_t;
248
249    fn isl_map_order_ge(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
250                        -> uintptr_t;
251
252    fn isl_map_order_le(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
253                        -> uintptr_t;
254
255    fn isl_map_equate(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
256                      -> uintptr_t;
257
258    fn isl_map_oppose(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
259                      -> uintptr_t;
260
261    fn isl_map_order_lt(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
262                        -> uintptr_t;
263
264    fn isl_map_order_gt(map: uintptr_t, type1: DimType, pos1: i32, type2: DimType, pos2: i32)
265                        -> uintptr_t;
266
267    fn isl_map_wrap(map: uintptr_t) -> uintptr_t;
268
269    fn isl_map_flatten(map: uintptr_t) -> uintptr_t;
270
271    fn isl_map_flatten_domain(map: uintptr_t) -> uintptr_t;
272
273    fn isl_map_flatten_range(map: uintptr_t) -> uintptr_t;
274
275    fn isl_map_params(map: uintptr_t) -> uintptr_t;
276
277    fn isl_map_domain(bmap: uintptr_t) -> uintptr_t;
278
279    fn isl_map_range(map: uintptr_t) -> uintptr_t;
280
281    fn isl_map_domain_map(map: uintptr_t) -> uintptr_t;
282
283    fn isl_map_range_map(map: uintptr_t) -> uintptr_t;
284
285    fn isl_map_from_basic_map(bmap: uintptr_t) -> uintptr_t;
286
287    fn isl_map_from_domain(set: uintptr_t) -> uintptr_t;
288
289    fn isl_map_from_range(set: uintptr_t) -> uintptr_t;
290
291    fn isl_map_from_domain_and_range(domain: uintptr_t, range: uintptr_t) -> uintptr_t;
292
293    fn isl_map_sample(map: uintptr_t) -> uintptr_t;
294
295    fn isl_map_plain_is_empty(map: uintptr_t) -> i32;
296
297    fn isl_map_plain_is_universe(map: uintptr_t) -> i32;
298
299    fn isl_map_is_empty(map: uintptr_t) -> i32;
300
301    fn isl_map_is_subset(map1: uintptr_t, map2: uintptr_t) -> i32;
302
303    fn isl_map_is_strict_subset(map1: uintptr_t, map2: uintptr_t) -> i32;
304
305    fn isl_map_is_equal(map1: uintptr_t, map2: uintptr_t) -> i32;
306
307    fn isl_map_is_disjoint(map1: uintptr_t, map2: uintptr_t) -> i32;
308
309    fn isl_map_plain_is_single_valued(map: uintptr_t) -> i32;
310
311    fn isl_map_is_single_valued(map: uintptr_t) -> i32;
312
313    fn isl_map_plain_is_injective(map: uintptr_t) -> i32;
314
315    fn isl_map_is_injective(map: uintptr_t) -> i32;
316
317    fn isl_map_is_bijective(map: uintptr_t) -> i32;
318
319    fn isl_map_is_identity(map: uintptr_t) -> i32;
320
321    fn isl_map_is_translation(map: uintptr_t) -> i32;
322
323    fn isl_map_has_equal_space(map1: uintptr_t, map2: uintptr_t) -> i32;
324
325    fn isl_map_can_zip(map: uintptr_t) -> i32;
326
327    fn isl_map_zip(map: uintptr_t) -> uintptr_t;
328
329    fn isl_map_can_curry(map: uintptr_t) -> i32;
330
331    fn isl_map_curry(map: uintptr_t) -> uintptr_t;
332
333    fn isl_map_can_range_curry(map: uintptr_t) -> i32;
334
335    fn isl_map_range_curry(map: uintptr_t) -> uintptr_t;
336
337    fn isl_map_can_uncurry(map: uintptr_t) -> i32;
338
339    fn isl_map_uncurry(map: uintptr_t) -> uintptr_t;
340
341    fn isl_map_make_disjoint(map: uintptr_t) -> uintptr_t;
342
343    fn isl_map_compute_divs(map: uintptr_t) -> uintptr_t;
344
345    fn isl_map_align_divs(map: uintptr_t) -> uintptr_t;
346
347    fn isl_map_drop_constraints_involving_dims(map: uintptr_t, type_: DimType, first: u32, n: u32)
348                                               -> uintptr_t;
349
350    fn isl_map_drop_constraints_not_involving_dims(map: uintptr_t, type_: DimType, first: u32,
351                                                   n: u32)
352                                                   -> uintptr_t;
353
354    fn isl_map_involves_dims(map: uintptr_t, type_: DimType, first: u32, n: u32) -> i32;
355
356    fn isl_map_plain_get_val_if_fixed(map: uintptr_t, type_: DimType, pos: u32) -> uintptr_t;
357
358    fn isl_map_gist(map: uintptr_t, context: uintptr_t) -> uintptr_t;
359
360    fn isl_map_gist_domain(map: uintptr_t, context: uintptr_t) -> uintptr_t;
361
362    fn isl_map_gist_range(map: uintptr_t, context: uintptr_t) -> uintptr_t;
363
364    fn isl_map_gist_params(map: uintptr_t, context: uintptr_t) -> uintptr_t;
365
366    fn isl_map_gist_basic_map(map: uintptr_t, context: uintptr_t) -> uintptr_t;
367
368    fn isl_map_get_range_stride_info(map: uintptr_t, pos: i32) -> uintptr_t;
369
370    fn isl_map_get_range_lattice_tile(map: uintptr_t) -> uintptr_t;
371
372    fn isl_map_get_range_simple_fixed_box_hull(map: uintptr_t) -> uintptr_t;
373
374    fn isl_map_coalesce(map: uintptr_t) -> uintptr_t;
375
376    fn isl_map_plain_is_equal(map1: uintptr_t, map2: uintptr_t) -> i32;
377
378    fn isl_map_get_hash(map: uintptr_t) -> u32;
379
380    fn isl_map_n_basic_map(map: uintptr_t) -> i32;
381
382    fn isl_map_fixed_power_val(map: uintptr_t, exp: uintptr_t) -> uintptr_t;
383
384    fn isl_map_lex_le_map(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
385
386    fn isl_map_lex_lt_map(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
387
388    fn isl_map_lex_ge_map(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
389
390    fn isl_map_lex_gt_map(map1: uintptr_t, map2: uintptr_t) -> uintptr_t;
391
392    fn isl_map_align_params(map: uintptr_t, model: uintptr_t) -> uintptr_t;
393
394    fn isl_map_drop_unused_params(map: uintptr_t) -> uintptr_t;
395
396    fn isl_map_from_aff(aff: uintptr_t) -> uintptr_t;
397
398    fn isl_map_dim_min(map: uintptr_t, pos: i32) -> uintptr_t;
399
400    fn isl_map_dim_max(map: uintptr_t, pos: i32) -> uintptr_t;
401
402}
403
404impl Map {
405    /// Wraps `isl_map_domain_tuple_dim`.
406    pub fn domain_tuple_dim(&self) -> i32 {
407        let map = self;
408        let map = map.ptr;
409        let isl_rs_result = unsafe { isl_map_domain_tuple_dim(map) };
410        isl_rs_result
411    }
412
413    /// Wraps `isl_map_range_tuple_dim`.
414    pub fn range_tuple_dim(&self) -> i32 {
415        let map = self;
416        let map = map.ptr;
417        let isl_rs_result = unsafe { isl_map_range_tuple_dim(map) };
418        isl_rs_result
419    }
420
421    /// Wraps `isl_map_dim`.
422    pub fn dim(&self, type_: DimType) -> i32 {
423        let map = self;
424        let map = map.ptr;
425        let isl_rs_result = unsafe { isl_map_dim(map, type_) };
426        isl_rs_result
427    }
428
429    /// Wraps `isl_map_get_ctx`.
430    pub fn get_ctx(&self) -> Context {
431        let map = self;
432        let map = map.ptr;
433        let isl_rs_result = unsafe { isl_map_get_ctx(map) };
434        let isl_rs_result = Context { ptr: isl_rs_result,
435                                      should_free_on_drop: true };
436        let mut isl_rs_result = isl_rs_result;
437        isl_rs_result.do_not_free_on_drop();
438        isl_rs_result
439    }
440
441    /// Wraps `isl_map_get_space`.
442    pub fn get_space(&self) -> Space {
443        let map = self;
444        let map = map.ptr;
445        let isl_rs_result = unsafe { isl_map_get_space(map) };
446        let isl_rs_result = Space { ptr: isl_rs_result,
447                                    should_free_on_drop: true };
448        isl_rs_result
449    }
450
451    /// Wraps `isl_map_has_tuple_name`.
452    pub fn has_tuple_name(&self, type_: DimType) -> bool {
453        let map = self;
454        let map = map.ptr;
455        let isl_rs_result = unsafe { isl_map_has_tuple_name(map, type_) };
456        let isl_rs_result = match isl_rs_result {
457            0 => false,
458            1 => true,
459            _ => panic!("Got isl_bool = -1"),
460        };
461        isl_rs_result
462    }
463
464    /// Wraps `isl_map_get_tuple_name`.
465    pub fn get_tuple_name(&self, type_: DimType) -> &str {
466        let map = self;
467        let map = map.ptr;
468        let isl_rs_result = unsafe { isl_map_get_tuple_name(map, type_) };
469        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
470        let isl_rs_result = isl_rs_result.to_str().unwrap();
471        isl_rs_result
472    }
473
474    /// Wraps `isl_map_set_tuple_name`.
475    pub fn set_tuple_name(self, type_: DimType, s: &str) -> Map {
476        let map = self;
477        let mut map = map;
478        map.do_not_free_on_drop();
479        let map = map.ptr;
480        let s = CString::new(s).unwrap();
481        let s = s.as_ptr();
482        let isl_rs_result = unsafe { isl_map_set_tuple_name(map, type_, s) };
483        let isl_rs_result = Map { ptr: isl_rs_result,
484                                  should_free_on_drop: true };
485        isl_rs_result
486    }
487
488    /// Wraps `isl_map_has_dim_name`.
489    pub fn has_dim_name(&self, type_: DimType, pos: u32) -> bool {
490        let map = self;
491        let map = map.ptr;
492        let isl_rs_result = unsafe { isl_map_has_dim_name(map, type_, pos) };
493        let isl_rs_result = match isl_rs_result {
494            0 => false,
495            1 => true,
496            _ => panic!("Got isl_bool = -1"),
497        };
498        isl_rs_result
499    }
500
501    /// Wraps `isl_map_get_dim_name`.
502    pub fn get_dim_name(&self, type_: DimType, pos: u32) -> &str {
503        let map = self;
504        let map = map.ptr;
505        let isl_rs_result = unsafe { isl_map_get_dim_name(map, type_, pos) };
506        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
507        let isl_rs_result = isl_rs_result.to_str().unwrap();
508        isl_rs_result
509    }
510
511    /// Wraps `isl_map_set_dim_name`.
512    pub fn set_dim_name(self, type_: DimType, pos: u32, s: &str) -> Map {
513        let map = self;
514        let mut map = map;
515        map.do_not_free_on_drop();
516        let map = map.ptr;
517        let s = CString::new(s).unwrap();
518        let s = s.as_ptr();
519        let isl_rs_result = unsafe { isl_map_set_dim_name(map, type_, pos, s) };
520        let isl_rs_result = Map { ptr: isl_rs_result,
521                                  should_free_on_drop: true };
522        isl_rs_result
523    }
524
525    /// Wraps `isl_map_set_dim_id`.
526    pub fn set_dim_id(self, type_: DimType, pos: u32, id: Id) -> Map {
527        let map = self;
528        let mut map = map;
529        map.do_not_free_on_drop();
530        let map = map.ptr;
531        let mut id = id;
532        id.do_not_free_on_drop();
533        let id = id.ptr;
534        let isl_rs_result = unsafe { isl_map_set_dim_id(map, type_, pos, id) };
535        let isl_rs_result = Map { ptr: isl_rs_result,
536                                  should_free_on_drop: true };
537        isl_rs_result
538    }
539
540    /// Wraps `isl_map_has_dim_id`.
541    pub fn has_dim_id(&self, type_: DimType, pos: u32) -> bool {
542        let map = self;
543        let map = map.ptr;
544        let isl_rs_result = unsafe { isl_map_has_dim_id(map, type_, pos) };
545        let isl_rs_result = match isl_rs_result {
546            0 => false,
547            1 => true,
548            _ => panic!("Got isl_bool = -1"),
549        };
550        isl_rs_result
551    }
552
553    /// Wraps `isl_map_get_dim_id`.
554    pub fn get_dim_id(&self, type_: DimType, pos: u32) -> Id {
555        let map = self;
556        let map = map.ptr;
557        let isl_rs_result = unsafe { isl_map_get_dim_id(map, type_, pos) };
558        let isl_rs_result = Id { ptr: isl_rs_result,
559                                 should_free_on_drop: true };
560        isl_rs_result
561    }
562
563    /// Wraps `isl_map_set_domain_tuple_id`.
564    pub fn set_domain_tuple_id(self, id: Id) -> Map {
565        let map = self;
566        let mut map = map;
567        map.do_not_free_on_drop();
568        let map = map.ptr;
569        let mut id = id;
570        id.do_not_free_on_drop();
571        let id = id.ptr;
572        let isl_rs_result = unsafe { isl_map_set_domain_tuple_id(map, id) };
573        let isl_rs_result = Map { ptr: isl_rs_result,
574                                  should_free_on_drop: true };
575        isl_rs_result
576    }
577
578    /// Wraps `isl_map_set_range_tuple_id`.
579    pub fn set_range_tuple_id(self, id: Id) -> Map {
580        let map = self;
581        let mut map = map;
582        map.do_not_free_on_drop();
583        let map = map.ptr;
584        let mut id = id;
585        id.do_not_free_on_drop();
586        let id = id.ptr;
587        let isl_rs_result = unsafe { isl_map_set_range_tuple_id(map, id) };
588        let isl_rs_result = Map { ptr: isl_rs_result,
589                                  should_free_on_drop: true };
590        isl_rs_result
591    }
592
593    /// Wraps `isl_map_set_tuple_id`.
594    pub fn set_tuple_id(self, type_: DimType, id: Id) -> Map {
595        let map = self;
596        let mut map = map;
597        map.do_not_free_on_drop();
598        let map = map.ptr;
599        let mut id = id;
600        id.do_not_free_on_drop();
601        let id = id.ptr;
602        let isl_rs_result = unsafe { isl_map_set_tuple_id(map, type_, id) };
603        let isl_rs_result = Map { ptr: isl_rs_result,
604                                  should_free_on_drop: true };
605        isl_rs_result
606    }
607
608    /// Wraps `isl_map_reset_tuple_id`.
609    pub fn reset_tuple_id(self, type_: DimType) -> Map {
610        let map = self;
611        let mut map = map;
612        map.do_not_free_on_drop();
613        let map = map.ptr;
614        let isl_rs_result = unsafe { isl_map_reset_tuple_id(map, type_) };
615        let isl_rs_result = Map { ptr: isl_rs_result,
616                                  should_free_on_drop: true };
617        isl_rs_result
618    }
619
620    /// Wraps `isl_map_has_domain_tuple_id`.
621    pub fn has_domain_tuple_id(&self) -> bool {
622        let map = self;
623        let map = map.ptr;
624        let isl_rs_result = unsafe { isl_map_has_domain_tuple_id(map) };
625        let isl_rs_result = match isl_rs_result {
626            0 => false,
627            1 => true,
628            _ => panic!("Got isl_bool = -1"),
629        };
630        isl_rs_result
631    }
632
633    /// Wraps `isl_map_has_range_tuple_id`.
634    pub fn has_range_tuple_id(&self) -> bool {
635        let map = self;
636        let map = map.ptr;
637        let isl_rs_result = unsafe { isl_map_has_range_tuple_id(map) };
638        let isl_rs_result = match isl_rs_result {
639            0 => false,
640            1 => true,
641            _ => panic!("Got isl_bool = -1"),
642        };
643        isl_rs_result
644    }
645
646    /// Wraps `isl_map_has_tuple_id`.
647    pub fn has_tuple_id(&self, type_: DimType) -> bool {
648        let map = self;
649        let map = map.ptr;
650        let isl_rs_result = unsafe { isl_map_has_tuple_id(map, type_) };
651        let isl_rs_result = match isl_rs_result {
652            0 => false,
653            1 => true,
654            _ => panic!("Got isl_bool = -1"),
655        };
656        isl_rs_result
657    }
658
659    /// Wraps `isl_map_get_domain_tuple_id`.
660    pub fn get_domain_tuple_id(&self) -> Id {
661        let map = self;
662        let map = map.ptr;
663        let isl_rs_result = unsafe { isl_map_get_domain_tuple_id(map) };
664        let isl_rs_result = Id { ptr: isl_rs_result,
665                                 should_free_on_drop: true };
666        isl_rs_result
667    }
668
669    /// Wraps `isl_map_get_range_tuple_id`.
670    pub fn get_range_tuple_id(&self) -> Id {
671        let map = self;
672        let map = map.ptr;
673        let isl_rs_result = unsafe { isl_map_get_range_tuple_id(map) };
674        let isl_rs_result = Id { ptr: isl_rs_result,
675                                 should_free_on_drop: true };
676        isl_rs_result
677    }
678
679    /// Wraps `isl_map_get_tuple_id`.
680    pub fn get_tuple_id(&self, type_: DimType) -> Id {
681        let map = self;
682        let map = map.ptr;
683        let isl_rs_result = unsafe { isl_map_get_tuple_id(map, type_) };
684        let isl_rs_result = Id { ptr: isl_rs_result,
685                                 should_free_on_drop: true };
686        isl_rs_result
687    }
688
689    /// Wraps `isl_map_reset_user`.
690    pub fn reset_user(self) -> Map {
691        let map = self;
692        let mut map = map;
693        map.do_not_free_on_drop();
694        let map = map.ptr;
695        let isl_rs_result = unsafe { isl_map_reset_user(map) };
696        let isl_rs_result = Map { ptr: isl_rs_result,
697                                  should_free_on_drop: true };
698        isl_rs_result
699    }
700
701    /// Wraps `isl_map_find_dim_by_id`.
702    pub fn find_dim_by_id(&self, type_: DimType, id: &Id) -> i32 {
703        let map = self;
704        let map = map.ptr;
705        let id = id.ptr;
706        let isl_rs_result = unsafe { isl_map_find_dim_by_id(map, type_, id) };
707        isl_rs_result
708    }
709
710    /// Wraps `isl_map_find_dim_by_name`.
711    pub fn find_dim_by_name(&self, type_: DimType, name: &str) -> i32 {
712        let map = self;
713        let map = map.ptr;
714        let name = CString::new(name).unwrap();
715        let name = name.as_ptr();
716        let isl_rs_result = unsafe { isl_map_find_dim_by_name(map, type_, name) };
717        isl_rs_result
718    }
719
720    /// Wraps `isl_map_remove_redundancies`.
721    pub fn remove_redundancies(self) -> Map {
722        let map = self;
723        let mut map = map;
724        map.do_not_free_on_drop();
725        let map = map.ptr;
726        let isl_rs_result = unsafe { isl_map_remove_redundancies(map) };
727        let isl_rs_result = Map { ptr: isl_rs_result,
728                                  should_free_on_drop: true };
729        isl_rs_result
730    }
731
732    /// Wraps `isl_map_simple_hull`.
733    pub fn simple_hull(self) -> BasicMap {
734        let map = self;
735        let mut map = map;
736        map.do_not_free_on_drop();
737        let map = map.ptr;
738        let isl_rs_result = unsafe { isl_map_simple_hull(map) };
739        let isl_rs_result = BasicMap { ptr: isl_rs_result,
740                                       should_free_on_drop: true };
741        isl_rs_result
742    }
743
744    /// Wraps `isl_map_unshifted_simple_hull`.
745    pub fn unshifted_simple_hull(self) -> BasicMap {
746        let map = self;
747        let mut map = map;
748        map.do_not_free_on_drop();
749        let map = map.ptr;
750        let isl_rs_result = unsafe { isl_map_unshifted_simple_hull(map) };
751        let isl_rs_result = BasicMap { ptr: isl_rs_result,
752                                       should_free_on_drop: true };
753        isl_rs_result
754    }
755
756    /// Wraps `isl_map_plain_unshifted_simple_hull`.
757    pub fn plain_unshifted_simple_hull(self) -> BasicMap {
758        let map = self;
759        let mut map = map;
760        map.do_not_free_on_drop();
761        let map = map.ptr;
762        let isl_rs_result = unsafe { isl_map_plain_unshifted_simple_hull(map) };
763        let isl_rs_result = BasicMap { ptr: isl_rs_result,
764                                       should_free_on_drop: true };
765        isl_rs_result
766    }
767
768    /// Wraps `isl_map_read_from_str`.
769    pub fn read_from_str(ctx: &Context, str_: &str) -> Map {
770        let ctx = ctx.ptr;
771        let str_ = CString::new(str_).unwrap();
772        let str_ = str_.as_ptr();
773        let isl_rs_result = unsafe { isl_map_read_from_str(ctx, str_) };
774        let isl_rs_result = Map { ptr: isl_rs_result,
775                                  should_free_on_drop: true };
776        isl_rs_result
777    }
778
779    /// Wraps `isl_map_dump`.
780    pub fn dump(&self) {
781        let map = self;
782        let map = map.ptr;
783        let isl_rs_result = unsafe { isl_map_dump(map) };
784        isl_rs_result
785    }
786
787    /// Wraps `isl_map_to_str`.
788    pub fn to_str(&self) -> &str {
789        let map = self;
790        let map = map.ptr;
791        let isl_rs_result = unsafe { isl_map_to_str(map) };
792        let isl_rs_result = unsafe { CStr::from_ptr(isl_rs_result) };
793        let isl_rs_result = isl_rs_result.to_str().unwrap();
794        isl_rs_result
795    }
796
797    /// Wraps `isl_map_sum`.
798    pub fn sum(self, map2: Map) -> Map {
799        let map1 = self;
800        let mut map1 = map1;
801        map1.do_not_free_on_drop();
802        let map1 = map1.ptr;
803        let mut map2 = map2;
804        map2.do_not_free_on_drop();
805        let map2 = map2.ptr;
806        let isl_rs_result = unsafe { isl_map_sum(map1, map2) };
807        let isl_rs_result = Map { ptr: isl_rs_result,
808                                  should_free_on_drop: true };
809        isl_rs_result
810    }
811
812    /// Wraps `isl_map_neg`.
813    pub fn neg(self) -> Map {
814        let map = self;
815        let mut map = map;
816        map.do_not_free_on_drop();
817        let map = map.ptr;
818        let isl_rs_result = unsafe { isl_map_neg(map) };
819        let isl_rs_result = Map { ptr: isl_rs_result,
820                                  should_free_on_drop: true };
821        isl_rs_result
822    }
823
824    /// Wraps `isl_map_floordiv_val`.
825    pub fn floordiv_val(self, d: Val) -> Map {
826        let map = self;
827        let mut map = map;
828        map.do_not_free_on_drop();
829        let map = map.ptr;
830        let mut d = d;
831        d.do_not_free_on_drop();
832        let d = d.ptr;
833        let isl_rs_result = unsafe { isl_map_floordiv_val(map, d) };
834        let isl_rs_result = Map { ptr: isl_rs_result,
835                                  should_free_on_drop: true };
836        isl_rs_result
837    }
838
839    /// Wraps `isl_map_lexmin`.
840    pub fn lexmin(self) -> Map {
841        let map = self;
842        let mut map = map;
843        map.do_not_free_on_drop();
844        let map = map.ptr;
845        let isl_rs_result = unsafe { isl_map_lexmin(map) };
846        let isl_rs_result = Map { ptr: isl_rs_result,
847                                  should_free_on_drop: true };
848        isl_rs_result
849    }
850
851    /// Wraps `isl_map_lexmax`.
852    pub fn lexmax(self) -> Map {
853        let map = self;
854        let mut map = map;
855        map.do_not_free_on_drop();
856        let map = map.ptr;
857        let isl_rs_result = unsafe { isl_map_lexmax(map) };
858        let isl_rs_result = Map { ptr: isl_rs_result,
859                                  should_free_on_drop: true };
860        isl_rs_result
861    }
862
863    /// Wraps `isl_map_universe`.
864    pub fn universe(space: Space) -> Map {
865        let mut space = space;
866        space.do_not_free_on_drop();
867        let space = space.ptr;
868        let isl_rs_result = unsafe { isl_map_universe(space) };
869        let isl_rs_result = Map { ptr: isl_rs_result,
870                                  should_free_on_drop: true };
871        isl_rs_result
872    }
873
874    /// Wraps `isl_map_nat_universe`.
875    pub fn nat_universe(space: Space) -> Map {
876        let mut space = space;
877        space.do_not_free_on_drop();
878        let space = space.ptr;
879        let isl_rs_result = unsafe { isl_map_nat_universe(space) };
880        let isl_rs_result = Map { ptr: isl_rs_result,
881                                  should_free_on_drop: true };
882        isl_rs_result
883    }
884
885    /// Wraps `isl_map_empty`.
886    pub fn empty(space: Space) -> Map {
887        let mut space = space;
888        space.do_not_free_on_drop();
889        let space = space.ptr;
890        let isl_rs_result = unsafe { isl_map_empty(space) };
891        let isl_rs_result = Map { ptr: isl_rs_result,
892                                  should_free_on_drop: true };
893        isl_rs_result
894    }
895
896    /// Wraps `isl_map_identity`.
897    pub fn identity(space: Space) -> Map {
898        let mut space = space;
899        space.do_not_free_on_drop();
900        let space = space.ptr;
901        let isl_rs_result = unsafe { isl_map_identity(space) };
902        let isl_rs_result = Map { ptr: isl_rs_result,
903                                  should_free_on_drop: true };
904        isl_rs_result
905    }
906
907    /// Wraps `isl_map_lex_lt_first`.
908    pub fn lex_lt_first(space: Space, n: u32) -> Map {
909        let mut space = space;
910        space.do_not_free_on_drop();
911        let space = space.ptr;
912        let isl_rs_result = unsafe { isl_map_lex_lt_first(space, n) };
913        let isl_rs_result = Map { ptr: isl_rs_result,
914                                  should_free_on_drop: true };
915        isl_rs_result
916    }
917
918    /// Wraps `isl_map_lex_le_first`.
919    pub fn lex_le_first(space: Space, n: u32) -> Map {
920        let mut space = space;
921        space.do_not_free_on_drop();
922        let space = space.ptr;
923        let isl_rs_result = unsafe { isl_map_lex_le_first(space, n) };
924        let isl_rs_result = Map { ptr: isl_rs_result,
925                                  should_free_on_drop: true };
926        isl_rs_result
927    }
928
929    /// Wraps `isl_map_lex_lt`.
930    pub fn lex_lt(set_space: Space) -> Map {
931        let mut set_space = set_space;
932        set_space.do_not_free_on_drop();
933        let set_space = set_space.ptr;
934        let isl_rs_result = unsafe { isl_map_lex_lt(set_space) };
935        let isl_rs_result = Map { ptr: isl_rs_result,
936                                  should_free_on_drop: true };
937        isl_rs_result
938    }
939
940    /// Wraps `isl_map_lex_le`.
941    pub fn lex_le(set_space: Space) -> Map {
942        let mut set_space = set_space;
943        set_space.do_not_free_on_drop();
944        let set_space = set_space.ptr;
945        let isl_rs_result = unsafe { isl_map_lex_le(set_space) };
946        let isl_rs_result = Map { ptr: isl_rs_result,
947                                  should_free_on_drop: true };
948        isl_rs_result
949    }
950
951    /// Wraps `isl_map_lex_gt_first`.
952    pub fn lex_gt_first(space: Space, n: u32) -> Map {
953        let mut space = space;
954        space.do_not_free_on_drop();
955        let space = space.ptr;
956        let isl_rs_result = unsafe { isl_map_lex_gt_first(space, n) };
957        let isl_rs_result = Map { ptr: isl_rs_result,
958                                  should_free_on_drop: true };
959        isl_rs_result
960    }
961
962    /// Wraps `isl_map_lex_ge_first`.
963    pub fn lex_ge_first(space: Space, n: u32) -> Map {
964        let mut space = space;
965        space.do_not_free_on_drop();
966        let space = space.ptr;
967        let isl_rs_result = unsafe { isl_map_lex_ge_first(space, n) };
968        let isl_rs_result = Map { ptr: isl_rs_result,
969                                  should_free_on_drop: true };
970        isl_rs_result
971    }
972
973    /// Wraps `isl_map_lex_gt`.
974    pub fn lex_gt(set_space: Space) -> Map {
975        let mut set_space = set_space;
976        set_space.do_not_free_on_drop();
977        let set_space = set_space.ptr;
978        let isl_rs_result = unsafe { isl_map_lex_gt(set_space) };
979        let isl_rs_result = Map { ptr: isl_rs_result,
980                                  should_free_on_drop: true };
981        isl_rs_result
982    }
983
984    /// Wraps `isl_map_lex_ge`.
985    pub fn lex_ge(set_space: Space) -> Map {
986        let mut set_space = set_space;
987        set_space.do_not_free_on_drop();
988        let set_space = set_space.ptr;
989        let isl_rs_result = unsafe { isl_map_lex_ge(set_space) };
990        let isl_rs_result = Map { ptr: isl_rs_result,
991                                  should_free_on_drop: true };
992        isl_rs_result
993    }
994
995    /// Wraps `isl_map_free`.
996    pub fn free(self) -> Map {
997        let map = self;
998        let mut map = map;
999        map.do_not_free_on_drop();
1000        let map = map.ptr;
1001        let isl_rs_result = unsafe { isl_map_free(map) };
1002        let isl_rs_result = Map { ptr: isl_rs_result,
1003                                  should_free_on_drop: true };
1004        isl_rs_result
1005    }
1006
1007    /// Wraps `isl_map_copy`.
1008    pub fn copy(&self) -> Map {
1009        let map = self;
1010        let map = map.ptr;
1011        let isl_rs_result = unsafe { isl_map_copy(map) };
1012        let isl_rs_result = Map { ptr: isl_rs_result,
1013                                  should_free_on_drop: true };
1014        isl_rs_result
1015    }
1016
1017    /// Wraps `isl_map_reverse`.
1018    pub fn reverse(self) -> Map {
1019        let map = self;
1020        let mut map = map;
1021        map.do_not_free_on_drop();
1022        let map = map.ptr;
1023        let isl_rs_result = unsafe { isl_map_reverse(map) };
1024        let isl_rs_result = Map { ptr: isl_rs_result,
1025                                  should_free_on_drop: true };
1026        isl_rs_result
1027    }
1028
1029    /// Wraps `isl_map_range_reverse`.
1030    pub fn range_reverse(self) -> Map {
1031        let map = self;
1032        let mut map = map;
1033        map.do_not_free_on_drop();
1034        let map = map.ptr;
1035        let isl_rs_result = unsafe { isl_map_range_reverse(map) };
1036        let isl_rs_result = Map { ptr: isl_rs_result,
1037                                  should_free_on_drop: true };
1038        isl_rs_result
1039    }
1040
1041    /// Wraps `isl_map_union`.
1042    pub fn union(self, map2: Map) -> Map {
1043        let map1 = self;
1044        let mut map1 = map1;
1045        map1.do_not_free_on_drop();
1046        let map1 = map1.ptr;
1047        let mut map2 = map2;
1048        map2.do_not_free_on_drop();
1049        let map2 = map2.ptr;
1050        let isl_rs_result = unsafe { isl_map_union(map1, map2) };
1051        let isl_rs_result = Map { ptr: isl_rs_result,
1052                                  should_free_on_drop: true };
1053        isl_rs_result
1054    }
1055
1056    /// Wraps `isl_map_union_disjoint`.
1057    pub fn union_disjoint(self, map2: Map) -> Map {
1058        let map1 = self;
1059        let mut map1 = map1;
1060        map1.do_not_free_on_drop();
1061        let map1 = map1.ptr;
1062        let mut map2 = map2;
1063        map2.do_not_free_on_drop();
1064        let map2 = map2.ptr;
1065        let isl_rs_result = unsafe { isl_map_union_disjoint(map1, map2) };
1066        let isl_rs_result = Map { ptr: isl_rs_result,
1067                                  should_free_on_drop: true };
1068        isl_rs_result
1069    }
1070
1071    /// Wraps `isl_map_intersect_domain`.
1072    pub fn intersect_domain(self, set: Set) -> Map {
1073        let map = self;
1074        let mut map = map;
1075        map.do_not_free_on_drop();
1076        let map = map.ptr;
1077        let mut set = set;
1078        set.do_not_free_on_drop();
1079        let set = set.ptr;
1080        let isl_rs_result = unsafe { isl_map_intersect_domain(map, set) };
1081        let isl_rs_result = Map { ptr: isl_rs_result,
1082                                  should_free_on_drop: true };
1083        isl_rs_result
1084    }
1085
1086    /// Wraps `isl_map_intersect_range`.
1087    pub fn intersect_range(self, set: Set) -> Map {
1088        let map = self;
1089        let mut map = map;
1090        map.do_not_free_on_drop();
1091        let map = map.ptr;
1092        let mut set = set;
1093        set.do_not_free_on_drop();
1094        let set = set.ptr;
1095        let isl_rs_result = unsafe { isl_map_intersect_range(map, set) };
1096        let isl_rs_result = Map { ptr: isl_rs_result,
1097                                  should_free_on_drop: true };
1098        isl_rs_result
1099    }
1100
1101    /// Wraps `isl_map_intersect_domain_factor_domain`.
1102    pub fn intersect_domain_factor_domain(self, factor: Map) -> Map {
1103        let map = self;
1104        let mut map = map;
1105        map.do_not_free_on_drop();
1106        let map = map.ptr;
1107        let mut factor = factor;
1108        factor.do_not_free_on_drop();
1109        let factor = factor.ptr;
1110        let isl_rs_result = unsafe { isl_map_intersect_domain_factor_domain(map, factor) };
1111        let isl_rs_result = Map { ptr: isl_rs_result,
1112                                  should_free_on_drop: true };
1113        isl_rs_result
1114    }
1115
1116    /// Wraps `isl_map_intersect_domain_factor_range`.
1117    pub fn intersect_domain_factor_range(self, factor: Map) -> Map {
1118        let map = self;
1119        let mut map = map;
1120        map.do_not_free_on_drop();
1121        let map = map.ptr;
1122        let mut factor = factor;
1123        factor.do_not_free_on_drop();
1124        let factor = factor.ptr;
1125        let isl_rs_result = unsafe { isl_map_intersect_domain_factor_range(map, factor) };
1126        let isl_rs_result = Map { ptr: isl_rs_result,
1127                                  should_free_on_drop: true };
1128        isl_rs_result
1129    }
1130
1131    /// Wraps `isl_map_intersect_range_factor_domain`.
1132    pub fn intersect_range_factor_domain(self, factor: Map) -> Map {
1133        let map = self;
1134        let mut map = map;
1135        map.do_not_free_on_drop();
1136        let map = map.ptr;
1137        let mut factor = factor;
1138        factor.do_not_free_on_drop();
1139        let factor = factor.ptr;
1140        let isl_rs_result = unsafe { isl_map_intersect_range_factor_domain(map, factor) };
1141        let isl_rs_result = Map { ptr: isl_rs_result,
1142                                  should_free_on_drop: true };
1143        isl_rs_result
1144    }
1145
1146    /// Wraps `isl_map_intersect_range_factor_range`.
1147    pub fn intersect_range_factor_range(self, factor: Map) -> Map {
1148        let map = self;
1149        let mut map = map;
1150        map.do_not_free_on_drop();
1151        let map = map.ptr;
1152        let mut factor = factor;
1153        factor.do_not_free_on_drop();
1154        let factor = factor.ptr;
1155        let isl_rs_result = unsafe { isl_map_intersect_range_factor_range(map, factor) };
1156        let isl_rs_result = Map { ptr: isl_rs_result,
1157                                  should_free_on_drop: true };
1158        isl_rs_result
1159    }
1160
1161    /// Wraps `isl_map_intersect_domain_wrapped_domain`.
1162    pub fn intersect_domain_wrapped_domain(self, domain: Set) -> Map {
1163        let map = self;
1164        let mut map = map;
1165        map.do_not_free_on_drop();
1166        let map = map.ptr;
1167        let mut domain = domain;
1168        domain.do_not_free_on_drop();
1169        let domain = domain.ptr;
1170        let isl_rs_result = unsafe { isl_map_intersect_domain_wrapped_domain(map, domain) };
1171        let isl_rs_result = Map { ptr: isl_rs_result,
1172                                  should_free_on_drop: true };
1173        isl_rs_result
1174    }
1175
1176    /// Wraps `isl_map_intersect_range_wrapped_domain`.
1177    pub fn intersect_range_wrapped_domain(self, domain: Set) -> Map {
1178        let map = self;
1179        let mut map = map;
1180        map.do_not_free_on_drop();
1181        let map = map.ptr;
1182        let mut domain = domain;
1183        domain.do_not_free_on_drop();
1184        let domain = domain.ptr;
1185        let isl_rs_result = unsafe { isl_map_intersect_range_wrapped_domain(map, domain) };
1186        let isl_rs_result = Map { ptr: isl_rs_result,
1187                                  should_free_on_drop: true };
1188        isl_rs_result
1189    }
1190
1191    /// Wraps `isl_map_apply_domain`.
1192    pub fn apply_domain(self, map2: Map) -> Map {
1193        let map1 = self;
1194        let mut map1 = map1;
1195        map1.do_not_free_on_drop();
1196        let map1 = map1.ptr;
1197        let mut map2 = map2;
1198        map2.do_not_free_on_drop();
1199        let map2 = map2.ptr;
1200        let isl_rs_result = unsafe { isl_map_apply_domain(map1, map2) };
1201        let isl_rs_result = Map { ptr: isl_rs_result,
1202                                  should_free_on_drop: true };
1203        isl_rs_result
1204    }
1205
1206    /// Wraps `isl_map_apply_range`.
1207    pub fn apply_range(self, map2: Map) -> Map {
1208        let map1 = self;
1209        let mut map1 = map1;
1210        map1.do_not_free_on_drop();
1211        let map1 = map1.ptr;
1212        let mut map2 = map2;
1213        map2.do_not_free_on_drop();
1214        let map2 = map2.ptr;
1215        let isl_rs_result = unsafe { isl_map_apply_range(map1, map2) };
1216        let isl_rs_result = Map { ptr: isl_rs_result,
1217                                  should_free_on_drop: true };
1218        isl_rs_result
1219    }
1220
1221    /// Wraps `isl_map_product`.
1222    pub fn product(self, map2: Map) -> Map {
1223        let map1 = self;
1224        let mut map1 = map1;
1225        map1.do_not_free_on_drop();
1226        let map1 = map1.ptr;
1227        let mut map2 = map2;
1228        map2.do_not_free_on_drop();
1229        let map2 = map2.ptr;
1230        let isl_rs_result = unsafe { isl_map_product(map1, map2) };
1231        let isl_rs_result = Map { ptr: isl_rs_result,
1232                                  should_free_on_drop: true };
1233        isl_rs_result
1234    }
1235
1236    /// Wraps `isl_map_domain_product`.
1237    pub fn domain_product(self, map2: Map) -> Map {
1238        let map1 = self;
1239        let mut map1 = map1;
1240        map1.do_not_free_on_drop();
1241        let map1 = map1.ptr;
1242        let mut map2 = map2;
1243        map2.do_not_free_on_drop();
1244        let map2 = map2.ptr;
1245        let isl_rs_result = unsafe { isl_map_domain_product(map1, map2) };
1246        let isl_rs_result = Map { ptr: isl_rs_result,
1247                                  should_free_on_drop: true };
1248        isl_rs_result
1249    }
1250
1251    /// Wraps `isl_map_range_product`.
1252    pub fn range_product(self, map2: Map) -> Map {
1253        let map1 = self;
1254        let mut map1 = map1;
1255        map1.do_not_free_on_drop();
1256        let map1 = map1.ptr;
1257        let mut map2 = map2;
1258        map2.do_not_free_on_drop();
1259        let map2 = map2.ptr;
1260        let isl_rs_result = unsafe { isl_map_range_product(map1, map2) };
1261        let isl_rs_result = Map { ptr: isl_rs_result,
1262                                  should_free_on_drop: true };
1263        isl_rs_result
1264    }
1265
1266    /// Wraps `isl_map_flat_product`.
1267    pub fn flat_product(self, map2: Map) -> Map {
1268        let map1 = self;
1269        let mut map1 = map1;
1270        map1.do_not_free_on_drop();
1271        let map1 = map1.ptr;
1272        let mut map2 = map2;
1273        map2.do_not_free_on_drop();
1274        let map2 = map2.ptr;
1275        let isl_rs_result = unsafe { isl_map_flat_product(map1, map2) };
1276        let isl_rs_result = Map { ptr: isl_rs_result,
1277                                  should_free_on_drop: true };
1278        isl_rs_result
1279    }
1280
1281    /// Wraps `isl_map_flat_domain_product`.
1282    pub fn flat_domain_product(self, map2: Map) -> Map {
1283        let map1 = self;
1284        let mut map1 = map1;
1285        map1.do_not_free_on_drop();
1286        let map1 = map1.ptr;
1287        let mut map2 = map2;
1288        map2.do_not_free_on_drop();
1289        let map2 = map2.ptr;
1290        let isl_rs_result = unsafe { isl_map_flat_domain_product(map1, map2) };
1291        let isl_rs_result = Map { ptr: isl_rs_result,
1292                                  should_free_on_drop: true };
1293        isl_rs_result
1294    }
1295
1296    /// Wraps `isl_map_flat_range_product`.
1297    pub fn flat_range_product(self, map2: Map) -> Map {
1298        let map1 = self;
1299        let mut map1 = map1;
1300        map1.do_not_free_on_drop();
1301        let map1 = map1.ptr;
1302        let mut map2 = map2;
1303        map2.do_not_free_on_drop();
1304        let map2 = map2.ptr;
1305        let isl_rs_result = unsafe { isl_map_flat_range_product(map1, map2) };
1306        let isl_rs_result = Map { ptr: isl_rs_result,
1307                                  should_free_on_drop: true };
1308        isl_rs_result
1309    }
1310
1311    /// Wraps `isl_map_domain_is_wrapping`.
1312    pub fn domain_is_wrapping(&self) -> bool {
1313        let map = self;
1314        let map = map.ptr;
1315        let isl_rs_result = unsafe { isl_map_domain_is_wrapping(map) };
1316        let isl_rs_result = match isl_rs_result {
1317            0 => false,
1318            1 => true,
1319            _ => panic!("Got isl_bool = -1"),
1320        };
1321        isl_rs_result
1322    }
1323
1324    /// Wraps `isl_map_range_is_wrapping`.
1325    pub fn range_is_wrapping(&self) -> bool {
1326        let map = self;
1327        let map = map.ptr;
1328        let isl_rs_result = unsafe { isl_map_range_is_wrapping(map) };
1329        let isl_rs_result = match isl_rs_result {
1330            0 => false,
1331            1 => true,
1332            _ => panic!("Got isl_bool = -1"),
1333        };
1334        isl_rs_result
1335    }
1336
1337    /// Wraps `isl_map_is_product`.
1338    pub fn is_product(&self) -> bool {
1339        let map = self;
1340        let map = map.ptr;
1341        let isl_rs_result = unsafe { isl_map_is_product(map) };
1342        let isl_rs_result = match isl_rs_result {
1343            0 => false,
1344            1 => true,
1345            _ => panic!("Got isl_bool = -1"),
1346        };
1347        isl_rs_result
1348    }
1349
1350    /// Wraps `isl_map_factor_domain`.
1351    pub fn factor_domain(self) -> Map {
1352        let map = self;
1353        let mut map = map;
1354        map.do_not_free_on_drop();
1355        let map = map.ptr;
1356        let isl_rs_result = unsafe { isl_map_factor_domain(map) };
1357        let isl_rs_result = Map { ptr: isl_rs_result,
1358                                  should_free_on_drop: true };
1359        isl_rs_result
1360    }
1361
1362    /// Wraps `isl_map_factor_range`.
1363    pub fn factor_range(self) -> Map {
1364        let map = self;
1365        let mut map = map;
1366        map.do_not_free_on_drop();
1367        let map = map.ptr;
1368        let isl_rs_result = unsafe { isl_map_factor_range(map) };
1369        let isl_rs_result = Map { ptr: isl_rs_result,
1370                                  should_free_on_drop: true };
1371        isl_rs_result
1372    }
1373
1374    /// Wraps `isl_map_domain_factor_domain`.
1375    pub fn domain_factor_domain(self) -> Map {
1376        let map = self;
1377        let mut map = map;
1378        map.do_not_free_on_drop();
1379        let map = map.ptr;
1380        let isl_rs_result = unsafe { isl_map_domain_factor_domain(map) };
1381        let isl_rs_result = Map { ptr: isl_rs_result,
1382                                  should_free_on_drop: true };
1383        isl_rs_result
1384    }
1385
1386    /// Wraps `isl_map_domain_factor_range`.
1387    pub fn domain_factor_range(self) -> Map {
1388        let map = self;
1389        let mut map = map;
1390        map.do_not_free_on_drop();
1391        let map = map.ptr;
1392        let isl_rs_result = unsafe { isl_map_domain_factor_range(map) };
1393        let isl_rs_result = Map { ptr: isl_rs_result,
1394                                  should_free_on_drop: true };
1395        isl_rs_result
1396    }
1397
1398    /// Wraps `isl_map_range_factor_domain`.
1399    pub fn range_factor_domain(self) -> Map {
1400        let map = self;
1401        let mut map = map;
1402        map.do_not_free_on_drop();
1403        let map = map.ptr;
1404        let isl_rs_result = unsafe { isl_map_range_factor_domain(map) };
1405        let isl_rs_result = Map { ptr: isl_rs_result,
1406                                  should_free_on_drop: true };
1407        isl_rs_result
1408    }
1409
1410    /// Wraps `isl_map_range_factor_range`.
1411    pub fn range_factor_range(self) -> Map {
1412        let map = self;
1413        let mut map = map;
1414        map.do_not_free_on_drop();
1415        let map = map.ptr;
1416        let isl_rs_result = unsafe { isl_map_range_factor_range(map) };
1417        let isl_rs_result = Map { ptr: isl_rs_result,
1418                                  should_free_on_drop: true };
1419        isl_rs_result
1420    }
1421
1422    /// Wraps `isl_map_intersect`.
1423    pub fn intersect(self, map2: Map) -> Map {
1424        let map1 = self;
1425        let mut map1 = map1;
1426        map1.do_not_free_on_drop();
1427        let map1 = map1.ptr;
1428        let mut map2 = map2;
1429        map2.do_not_free_on_drop();
1430        let map2 = map2.ptr;
1431        let isl_rs_result = unsafe { isl_map_intersect(map1, map2) };
1432        let isl_rs_result = Map { ptr: isl_rs_result,
1433                                  should_free_on_drop: true };
1434        isl_rs_result
1435    }
1436
1437    /// Wraps `isl_map_intersect_params`.
1438    pub fn intersect_params(self, params: Set) -> Map {
1439        let map = self;
1440        let mut map = map;
1441        map.do_not_free_on_drop();
1442        let map = map.ptr;
1443        let mut params = params;
1444        params.do_not_free_on_drop();
1445        let params = params.ptr;
1446        let isl_rs_result = unsafe { isl_map_intersect_params(map, params) };
1447        let isl_rs_result = Map { ptr: isl_rs_result,
1448                                  should_free_on_drop: true };
1449        isl_rs_result
1450    }
1451
1452    /// Wraps `isl_map_subtract`.
1453    pub fn subtract(self, map2: Map) -> Map {
1454        let map1 = self;
1455        let mut map1 = map1;
1456        map1.do_not_free_on_drop();
1457        let map1 = map1.ptr;
1458        let mut map2 = map2;
1459        map2.do_not_free_on_drop();
1460        let map2 = map2.ptr;
1461        let isl_rs_result = unsafe { isl_map_subtract(map1, map2) };
1462        let isl_rs_result = Map { ptr: isl_rs_result,
1463                                  should_free_on_drop: true };
1464        isl_rs_result
1465    }
1466
1467    /// Wraps `isl_map_subtract_domain`.
1468    pub fn subtract_domain(self, dom: Set) -> Map {
1469        let map = self;
1470        let mut map = map;
1471        map.do_not_free_on_drop();
1472        let map = map.ptr;
1473        let mut dom = dom;
1474        dom.do_not_free_on_drop();
1475        let dom = dom.ptr;
1476        let isl_rs_result = unsafe { isl_map_subtract_domain(map, dom) };
1477        let isl_rs_result = Map { ptr: isl_rs_result,
1478                                  should_free_on_drop: true };
1479        isl_rs_result
1480    }
1481
1482    /// Wraps `isl_map_subtract_range`.
1483    pub fn subtract_range(self, dom: Set) -> Map {
1484        let map = self;
1485        let mut map = map;
1486        map.do_not_free_on_drop();
1487        let map = map.ptr;
1488        let mut dom = dom;
1489        dom.do_not_free_on_drop();
1490        let dom = dom.ptr;
1491        let isl_rs_result = unsafe { isl_map_subtract_range(map, dom) };
1492        let isl_rs_result = Map { ptr: isl_rs_result,
1493                                  should_free_on_drop: true };
1494        isl_rs_result
1495    }
1496
1497    /// Wraps `isl_map_complement`.
1498    pub fn complement(self) -> Map {
1499        let map = self;
1500        let mut map = map;
1501        map.do_not_free_on_drop();
1502        let map = map.ptr;
1503        let isl_rs_result = unsafe { isl_map_complement(map) };
1504        let isl_rs_result = Map { ptr: isl_rs_result,
1505                                  should_free_on_drop: true };
1506        isl_rs_result
1507    }
1508
1509    /// Wraps `isl_map_fix_input_si`.
1510    pub fn fix_input_si(self, input: u32, value: i32) -> Map {
1511        let map = self;
1512        let mut map = map;
1513        map.do_not_free_on_drop();
1514        let map = map.ptr;
1515        let isl_rs_result = unsafe { isl_map_fix_input_si(map, input, value) };
1516        let isl_rs_result = Map { ptr: isl_rs_result,
1517                                  should_free_on_drop: true };
1518        isl_rs_result
1519    }
1520
1521    /// Wraps `isl_map_fix_si`.
1522    pub fn fix_si(self, type_: DimType, pos: u32, value: i32) -> Map {
1523        let map = self;
1524        let mut map = map;
1525        map.do_not_free_on_drop();
1526        let map = map.ptr;
1527        let isl_rs_result = unsafe { isl_map_fix_si(map, type_, pos, value) };
1528        let isl_rs_result = Map { ptr: isl_rs_result,
1529                                  should_free_on_drop: true };
1530        isl_rs_result
1531    }
1532
1533    /// Wraps `isl_map_fix_val`.
1534    pub fn fix_val(self, type_: DimType, pos: u32, v: Val) -> Map {
1535        let map = self;
1536        let mut map = map;
1537        map.do_not_free_on_drop();
1538        let map = map.ptr;
1539        let mut v = v;
1540        v.do_not_free_on_drop();
1541        let v = v.ptr;
1542        let isl_rs_result = unsafe { isl_map_fix_val(map, type_, pos, v) };
1543        let isl_rs_result = Map { ptr: isl_rs_result,
1544                                  should_free_on_drop: true };
1545        isl_rs_result
1546    }
1547
1548    /// Wraps `isl_map_lower_bound_si`.
1549    pub fn lower_bound_si(self, type_: DimType, pos: u32, value: i32) -> Map {
1550        let map = self;
1551        let mut map = map;
1552        map.do_not_free_on_drop();
1553        let map = map.ptr;
1554        let isl_rs_result = unsafe { isl_map_lower_bound_si(map, type_, pos, value) };
1555        let isl_rs_result = Map { ptr: isl_rs_result,
1556                                  should_free_on_drop: true };
1557        isl_rs_result
1558    }
1559
1560    /// Wraps `isl_map_lower_bound_val`.
1561    pub fn lower_bound_val(self, type_: DimType, pos: u32, value: Val) -> Map {
1562        let map = self;
1563        let mut map = map;
1564        map.do_not_free_on_drop();
1565        let map = map.ptr;
1566        let mut value = value;
1567        value.do_not_free_on_drop();
1568        let value = value.ptr;
1569        let isl_rs_result = unsafe { isl_map_lower_bound_val(map, type_, pos, value) };
1570        let isl_rs_result = Map { ptr: isl_rs_result,
1571                                  should_free_on_drop: true };
1572        isl_rs_result
1573    }
1574
1575    /// Wraps `isl_map_upper_bound_si`.
1576    pub fn upper_bound_si(self, type_: DimType, pos: u32, value: i32) -> Map {
1577        let map = self;
1578        let mut map = map;
1579        map.do_not_free_on_drop();
1580        let map = map.ptr;
1581        let isl_rs_result = unsafe { isl_map_upper_bound_si(map, type_, pos, value) };
1582        let isl_rs_result = Map { ptr: isl_rs_result,
1583                                  should_free_on_drop: true };
1584        isl_rs_result
1585    }
1586
1587    /// Wraps `isl_map_upper_bound_val`.
1588    pub fn upper_bound_val(self, type_: DimType, pos: u32, value: Val) -> Map {
1589        let map = self;
1590        let mut map = map;
1591        map.do_not_free_on_drop();
1592        let map = map.ptr;
1593        let mut value = value;
1594        value.do_not_free_on_drop();
1595        let value = value.ptr;
1596        let isl_rs_result = unsafe { isl_map_upper_bound_val(map, type_, pos, value) };
1597        let isl_rs_result = Map { ptr: isl_rs_result,
1598                                  should_free_on_drop: true };
1599        isl_rs_result
1600    }
1601
1602    /// Wraps `isl_map_deltas`.
1603    pub fn deltas(self) -> Set {
1604        let map = self;
1605        let mut map = map;
1606        map.do_not_free_on_drop();
1607        let map = map.ptr;
1608        let isl_rs_result = unsafe { isl_map_deltas(map) };
1609        let isl_rs_result = Set { ptr: isl_rs_result,
1610                                  should_free_on_drop: true };
1611        isl_rs_result
1612    }
1613
1614    /// Wraps `isl_map_deltas_map`.
1615    pub fn deltas_map(self) -> Map {
1616        let map = self;
1617        let mut map = map;
1618        map.do_not_free_on_drop();
1619        let map = map.ptr;
1620        let isl_rs_result = unsafe { isl_map_deltas_map(map) };
1621        let isl_rs_result = Map { ptr: isl_rs_result,
1622                                  should_free_on_drop: true };
1623        isl_rs_result
1624    }
1625
1626    /// Wraps `isl_map_detect_equalities`.
1627    pub fn detect_equalities(self) -> Map {
1628        let map = self;
1629        let mut map = map;
1630        map.do_not_free_on_drop();
1631        let map = map.ptr;
1632        let isl_rs_result = unsafe { isl_map_detect_equalities(map) };
1633        let isl_rs_result = Map { ptr: isl_rs_result,
1634                                  should_free_on_drop: true };
1635        isl_rs_result
1636    }
1637
1638    /// Wraps `isl_map_affine_hull`.
1639    pub fn affine_hull(self) -> BasicMap {
1640        let map = self;
1641        let mut map = map;
1642        map.do_not_free_on_drop();
1643        let map = map.ptr;
1644        let isl_rs_result = unsafe { isl_map_affine_hull(map) };
1645        let isl_rs_result = BasicMap { ptr: isl_rs_result,
1646                                       should_free_on_drop: true };
1647        isl_rs_result
1648    }
1649
1650    /// Wraps `isl_map_convex_hull`.
1651    pub fn convex_hull(self) -> BasicMap {
1652        let map = self;
1653        let mut map = map;
1654        map.do_not_free_on_drop();
1655        let map = map.ptr;
1656        let isl_rs_result = unsafe { isl_map_convex_hull(map) };
1657        let isl_rs_result = BasicMap { ptr: isl_rs_result,
1658                                       should_free_on_drop: true };
1659        isl_rs_result
1660    }
1661
1662    /// Wraps `isl_map_polyhedral_hull`.
1663    pub fn polyhedral_hull(self) -> BasicMap {
1664        let map = self;
1665        let mut map = map;
1666        map.do_not_free_on_drop();
1667        let map = map.ptr;
1668        let isl_rs_result = unsafe { isl_map_polyhedral_hull(map) };
1669        let isl_rs_result = BasicMap { ptr: isl_rs_result,
1670                                       should_free_on_drop: true };
1671        isl_rs_result
1672    }
1673
1674    /// Wraps `isl_map_add_dims`.
1675    pub fn add_dims(self, type_: DimType, n: u32) -> Map {
1676        let map = self;
1677        let mut map = map;
1678        map.do_not_free_on_drop();
1679        let map = map.ptr;
1680        let isl_rs_result = unsafe { isl_map_add_dims(map, type_, n) };
1681        let isl_rs_result = Map { ptr: isl_rs_result,
1682                                  should_free_on_drop: true };
1683        isl_rs_result
1684    }
1685
1686    /// Wraps `isl_map_insert_dims`.
1687    pub fn insert_dims(self, type_: DimType, pos: u32, n: u32) -> Map {
1688        let map = self;
1689        let mut map = map;
1690        map.do_not_free_on_drop();
1691        let map = map.ptr;
1692        let isl_rs_result = unsafe { isl_map_insert_dims(map, type_, pos, n) };
1693        let isl_rs_result = Map { ptr: isl_rs_result,
1694                                  should_free_on_drop: true };
1695        isl_rs_result
1696    }
1697
1698    /// Wraps `isl_map_move_dims`.
1699    pub fn move_dims(self, dst_type: DimType, dst_pos: u32, src_type: DimType, src_pos: u32,
1700                     n: u32)
1701                     -> Map {
1702        let map = self;
1703        let mut map = map;
1704        map.do_not_free_on_drop();
1705        let map = map.ptr;
1706        let isl_rs_result =
1707            unsafe { isl_map_move_dims(map, dst_type, dst_pos, src_type, src_pos, n) };
1708        let isl_rs_result = Map { ptr: isl_rs_result,
1709                                  should_free_on_drop: true };
1710        isl_rs_result
1711    }
1712
1713    /// Wraps `isl_map_project_out`.
1714    pub fn project_out(self, type_: DimType, first: u32, n: u32) -> Map {
1715        let map = self;
1716        let mut map = map;
1717        map.do_not_free_on_drop();
1718        let map = map.ptr;
1719        let isl_rs_result = unsafe { isl_map_project_out(map, type_, first, n) };
1720        let isl_rs_result = Map { ptr: isl_rs_result,
1721                                  should_free_on_drop: true };
1722        isl_rs_result
1723    }
1724
1725    /// Wraps `isl_map_project_out_all_params`.
1726    pub fn project_out_all_params(self) -> Map {
1727        let map = self;
1728        let mut map = map;
1729        map.do_not_free_on_drop();
1730        let map = map.ptr;
1731        let isl_rs_result = unsafe { isl_map_project_out_all_params(map) };
1732        let isl_rs_result = Map { ptr: isl_rs_result,
1733                                  should_free_on_drop: true };
1734        isl_rs_result
1735    }
1736
1737    /// Wraps `isl_map_remove_unknown_divs`.
1738    pub fn remove_unknown_divs(self) -> Map {
1739        let map = self;
1740        let mut map = map;
1741        map.do_not_free_on_drop();
1742        let map = map.ptr;
1743        let isl_rs_result = unsafe { isl_map_remove_unknown_divs(map) };
1744        let isl_rs_result = Map { ptr: isl_rs_result,
1745                                  should_free_on_drop: true };
1746        isl_rs_result
1747    }
1748
1749    /// Wraps `isl_map_remove_divs`.
1750    pub fn remove_divs(self) -> Map {
1751        let map = self;
1752        let mut map = map;
1753        map.do_not_free_on_drop();
1754        let map = map.ptr;
1755        let isl_rs_result = unsafe { isl_map_remove_divs(map) };
1756        let isl_rs_result = Map { ptr: isl_rs_result,
1757                                  should_free_on_drop: true };
1758        isl_rs_result
1759    }
1760
1761    /// Wraps `isl_map_eliminate`.
1762    pub fn eliminate(self, type_: DimType, first: u32, n: u32) -> Map {
1763        let map = self;
1764        let mut map = map;
1765        map.do_not_free_on_drop();
1766        let map = map.ptr;
1767        let isl_rs_result = unsafe { isl_map_eliminate(map, type_, first, n) };
1768        let isl_rs_result = Map { ptr: isl_rs_result,
1769                                  should_free_on_drop: true };
1770        isl_rs_result
1771    }
1772
1773    /// Wraps `isl_map_remove_dims`.
1774    pub fn remove_dims(self, type_: DimType, first: u32, n: u32) -> Map {
1775        let map = self;
1776        let mut map = map;
1777        map.do_not_free_on_drop();
1778        let map = map.ptr;
1779        let isl_rs_result = unsafe { isl_map_remove_dims(map, type_, first, n) };
1780        let isl_rs_result = Map { ptr: isl_rs_result,
1781                                  should_free_on_drop: true };
1782        isl_rs_result
1783    }
1784
1785    /// Wraps `isl_map_remove_divs_involving_dims`.
1786    pub fn remove_divs_involving_dims(self, type_: DimType, first: u32, n: u32) -> Map {
1787        let map = self;
1788        let mut map = map;
1789        map.do_not_free_on_drop();
1790        let map = map.ptr;
1791        let isl_rs_result = unsafe { isl_map_remove_divs_involving_dims(map, type_, first, n) };
1792        let isl_rs_result = Map { ptr: isl_rs_result,
1793                                  should_free_on_drop: true };
1794        isl_rs_result
1795    }
1796
1797    /// Wraps `isl_map_remove_inputs`.
1798    pub fn remove_inputs(self, first: u32, n: u32) -> Map {
1799        let map = self;
1800        let mut map = map;
1801        map.do_not_free_on_drop();
1802        let map = map.ptr;
1803        let isl_rs_result = unsafe { isl_map_remove_inputs(map, first, n) };
1804        let isl_rs_result = Map { ptr: isl_rs_result,
1805                                  should_free_on_drop: true };
1806        isl_rs_result
1807    }
1808
1809    /// Wraps `isl_map_order_ge`.
1810    pub fn order_ge(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1811        let map = self;
1812        let mut map = map;
1813        map.do_not_free_on_drop();
1814        let map = map.ptr;
1815        let isl_rs_result = unsafe { isl_map_order_ge(map, type1, pos1, type2, pos2) };
1816        let isl_rs_result = Map { ptr: isl_rs_result,
1817                                  should_free_on_drop: true };
1818        isl_rs_result
1819    }
1820
1821    /// Wraps `isl_map_order_le`.
1822    pub fn order_le(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1823        let map = self;
1824        let mut map = map;
1825        map.do_not_free_on_drop();
1826        let map = map.ptr;
1827        let isl_rs_result = unsafe { isl_map_order_le(map, type1, pos1, type2, pos2) };
1828        let isl_rs_result = Map { ptr: isl_rs_result,
1829                                  should_free_on_drop: true };
1830        isl_rs_result
1831    }
1832
1833    /// Wraps `isl_map_equate`.
1834    pub fn equate(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1835        let map = self;
1836        let mut map = map;
1837        map.do_not_free_on_drop();
1838        let map = map.ptr;
1839        let isl_rs_result = unsafe { isl_map_equate(map, type1, pos1, type2, pos2) };
1840        let isl_rs_result = Map { ptr: isl_rs_result,
1841                                  should_free_on_drop: true };
1842        isl_rs_result
1843    }
1844
1845    /// Wraps `isl_map_oppose`.
1846    pub fn oppose(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1847        let map = self;
1848        let mut map = map;
1849        map.do_not_free_on_drop();
1850        let map = map.ptr;
1851        let isl_rs_result = unsafe { isl_map_oppose(map, type1, pos1, type2, pos2) };
1852        let isl_rs_result = Map { ptr: isl_rs_result,
1853                                  should_free_on_drop: true };
1854        isl_rs_result
1855    }
1856
1857    /// Wraps `isl_map_order_lt`.
1858    pub fn order_lt(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1859        let map = self;
1860        let mut map = map;
1861        map.do_not_free_on_drop();
1862        let map = map.ptr;
1863        let isl_rs_result = unsafe { isl_map_order_lt(map, type1, pos1, type2, pos2) };
1864        let isl_rs_result = Map { ptr: isl_rs_result,
1865                                  should_free_on_drop: true };
1866        isl_rs_result
1867    }
1868
1869    /// Wraps `isl_map_order_gt`.
1870    pub fn order_gt(self, type1: DimType, pos1: i32, type2: DimType, pos2: i32) -> Map {
1871        let map = self;
1872        let mut map = map;
1873        map.do_not_free_on_drop();
1874        let map = map.ptr;
1875        let isl_rs_result = unsafe { isl_map_order_gt(map, type1, pos1, type2, pos2) };
1876        let isl_rs_result = Map { ptr: isl_rs_result,
1877                                  should_free_on_drop: true };
1878        isl_rs_result
1879    }
1880
1881    /// Wraps `isl_map_wrap`.
1882    pub fn wrap(self) -> Set {
1883        let map = self;
1884        let mut map = map;
1885        map.do_not_free_on_drop();
1886        let map = map.ptr;
1887        let isl_rs_result = unsafe { isl_map_wrap(map) };
1888        let isl_rs_result = Set { ptr: isl_rs_result,
1889                                  should_free_on_drop: true };
1890        isl_rs_result
1891    }
1892
1893    /// Wraps `isl_map_flatten`.
1894    pub fn flatten(self) -> Map {
1895        let map = self;
1896        let mut map = map;
1897        map.do_not_free_on_drop();
1898        let map = map.ptr;
1899        let isl_rs_result = unsafe { isl_map_flatten(map) };
1900        let isl_rs_result = Map { ptr: isl_rs_result,
1901                                  should_free_on_drop: true };
1902        isl_rs_result
1903    }
1904
1905    /// Wraps `isl_map_flatten_domain`.
1906    pub fn flatten_domain(self) -> Map {
1907        let map = self;
1908        let mut map = map;
1909        map.do_not_free_on_drop();
1910        let map = map.ptr;
1911        let isl_rs_result = unsafe { isl_map_flatten_domain(map) };
1912        let isl_rs_result = Map { ptr: isl_rs_result,
1913                                  should_free_on_drop: true };
1914        isl_rs_result
1915    }
1916
1917    /// Wraps `isl_map_flatten_range`.
1918    pub fn flatten_range(self) -> Map {
1919        let map = self;
1920        let mut map = map;
1921        map.do_not_free_on_drop();
1922        let map = map.ptr;
1923        let isl_rs_result = unsafe { isl_map_flatten_range(map) };
1924        let isl_rs_result = Map { ptr: isl_rs_result,
1925                                  should_free_on_drop: true };
1926        isl_rs_result
1927    }
1928
1929    /// Wraps `isl_map_params`.
1930    pub fn params(self) -> Set {
1931        let map = self;
1932        let mut map = map;
1933        map.do_not_free_on_drop();
1934        let map = map.ptr;
1935        let isl_rs_result = unsafe { isl_map_params(map) };
1936        let isl_rs_result = Set { ptr: isl_rs_result,
1937                                  should_free_on_drop: true };
1938        isl_rs_result
1939    }
1940
1941    /// Wraps `isl_map_domain`.
1942    pub fn domain(self) -> Set {
1943        let bmap = self;
1944        let mut bmap = bmap;
1945        bmap.do_not_free_on_drop();
1946        let bmap = bmap.ptr;
1947        let isl_rs_result = unsafe { isl_map_domain(bmap) };
1948        let isl_rs_result = Set { ptr: isl_rs_result,
1949                                  should_free_on_drop: true };
1950        isl_rs_result
1951    }
1952
1953    /// Wraps `isl_map_range`.
1954    pub fn range(self) -> Set {
1955        let map = self;
1956        let mut map = map;
1957        map.do_not_free_on_drop();
1958        let map = map.ptr;
1959        let isl_rs_result = unsafe { isl_map_range(map) };
1960        let isl_rs_result = Set { ptr: isl_rs_result,
1961                                  should_free_on_drop: true };
1962        isl_rs_result
1963    }
1964
1965    /// Wraps `isl_map_domain_map`.
1966    pub fn domain_map(self) -> Map {
1967        let map = self;
1968        let mut map = map;
1969        map.do_not_free_on_drop();
1970        let map = map.ptr;
1971        let isl_rs_result = unsafe { isl_map_domain_map(map) };
1972        let isl_rs_result = Map { ptr: isl_rs_result,
1973                                  should_free_on_drop: true };
1974        isl_rs_result
1975    }
1976
1977    /// Wraps `isl_map_range_map`.
1978    pub fn range_map(self) -> Map {
1979        let map = self;
1980        let mut map = map;
1981        map.do_not_free_on_drop();
1982        let map = map.ptr;
1983        let isl_rs_result = unsafe { isl_map_range_map(map) };
1984        let isl_rs_result = Map { ptr: isl_rs_result,
1985                                  should_free_on_drop: true };
1986        isl_rs_result
1987    }
1988
1989    /// Wraps `isl_map_from_basic_map`.
1990    pub fn from_basic_map(bmap: BasicMap) -> Map {
1991        let mut bmap = bmap;
1992        bmap.do_not_free_on_drop();
1993        let bmap = bmap.ptr;
1994        let isl_rs_result = unsafe { isl_map_from_basic_map(bmap) };
1995        let isl_rs_result = Map { ptr: isl_rs_result,
1996                                  should_free_on_drop: true };
1997        isl_rs_result
1998    }
1999
2000    /// Wraps `isl_map_from_domain`.
2001    pub fn from_domain(set: Set) -> Map {
2002        let mut set = set;
2003        set.do_not_free_on_drop();
2004        let set = set.ptr;
2005        let isl_rs_result = unsafe { isl_map_from_domain(set) };
2006        let isl_rs_result = Map { ptr: isl_rs_result,
2007                                  should_free_on_drop: true };
2008        isl_rs_result
2009    }
2010
2011    /// Wraps `isl_map_from_range`.
2012    pub fn from_range(set: Set) -> Map {
2013        let mut set = set;
2014        set.do_not_free_on_drop();
2015        let set = set.ptr;
2016        let isl_rs_result = unsafe { isl_map_from_range(set) };
2017        let isl_rs_result = Map { ptr: isl_rs_result,
2018                                  should_free_on_drop: true };
2019        isl_rs_result
2020    }
2021
2022    /// Wraps `isl_map_from_domain_and_range`.
2023    pub fn from_domain_and_range(domain: Set, range: Set) -> Map {
2024        let mut domain = domain;
2025        domain.do_not_free_on_drop();
2026        let domain = domain.ptr;
2027        let mut range = range;
2028        range.do_not_free_on_drop();
2029        let range = range.ptr;
2030        let isl_rs_result = unsafe { isl_map_from_domain_and_range(domain, range) };
2031        let isl_rs_result = Map { ptr: isl_rs_result,
2032                                  should_free_on_drop: true };
2033        isl_rs_result
2034    }
2035
2036    /// Wraps `isl_map_sample`.
2037    pub fn sample(self) -> BasicMap {
2038        let map = self;
2039        let mut map = map;
2040        map.do_not_free_on_drop();
2041        let map = map.ptr;
2042        let isl_rs_result = unsafe { isl_map_sample(map) };
2043        let isl_rs_result = BasicMap { ptr: isl_rs_result,
2044                                       should_free_on_drop: true };
2045        isl_rs_result
2046    }
2047
2048    /// Wraps `isl_map_plain_is_empty`.
2049    pub fn plain_is_empty(&self) -> bool {
2050        let map = self;
2051        let map = map.ptr;
2052        let isl_rs_result = unsafe { isl_map_plain_is_empty(map) };
2053        let isl_rs_result = match isl_rs_result {
2054            0 => false,
2055            1 => true,
2056            _ => panic!("Got isl_bool = -1"),
2057        };
2058        isl_rs_result
2059    }
2060
2061    /// Wraps `isl_map_plain_is_universe`.
2062    pub fn plain_is_universe(&self) -> bool {
2063        let map = self;
2064        let map = map.ptr;
2065        let isl_rs_result = unsafe { isl_map_plain_is_universe(map) };
2066        let isl_rs_result = match isl_rs_result {
2067            0 => false,
2068            1 => true,
2069            _ => panic!("Got isl_bool = -1"),
2070        };
2071        isl_rs_result
2072    }
2073
2074    /// Wraps `isl_map_is_empty`.
2075    pub fn is_empty(&self) -> bool {
2076        let map = self;
2077        let map = map.ptr;
2078        let isl_rs_result = unsafe { isl_map_is_empty(map) };
2079        let isl_rs_result = match isl_rs_result {
2080            0 => false,
2081            1 => true,
2082            _ => panic!("Got isl_bool = -1"),
2083        };
2084        isl_rs_result
2085    }
2086
2087    /// Wraps `isl_map_is_subset`.
2088    pub fn is_subset(&self, map2: &Map) -> bool {
2089        let map1 = self;
2090        let map1 = map1.ptr;
2091        let map2 = map2.ptr;
2092        let isl_rs_result = unsafe { isl_map_is_subset(map1, map2) };
2093        let isl_rs_result = match isl_rs_result {
2094            0 => false,
2095            1 => true,
2096            _ => panic!("Got isl_bool = -1"),
2097        };
2098        isl_rs_result
2099    }
2100
2101    /// Wraps `isl_map_is_strict_subset`.
2102    pub fn is_strict_subset(&self, map2: &Map) -> bool {
2103        let map1 = self;
2104        let map1 = map1.ptr;
2105        let map2 = map2.ptr;
2106        let isl_rs_result = unsafe { isl_map_is_strict_subset(map1, map2) };
2107        let isl_rs_result = match isl_rs_result {
2108            0 => false,
2109            1 => true,
2110            _ => panic!("Got isl_bool = -1"),
2111        };
2112        isl_rs_result
2113    }
2114
2115    /// Wraps `isl_map_is_equal`.
2116    pub fn is_equal(&self, map2: &Map) -> bool {
2117        let map1 = self;
2118        let map1 = map1.ptr;
2119        let map2 = map2.ptr;
2120        let isl_rs_result = unsafe { isl_map_is_equal(map1, map2) };
2121        let isl_rs_result = match isl_rs_result {
2122            0 => false,
2123            1 => true,
2124            _ => panic!("Got isl_bool = -1"),
2125        };
2126        isl_rs_result
2127    }
2128
2129    /// Wraps `isl_map_is_disjoint`.
2130    pub fn is_disjoint(&self, map2: &Map) -> bool {
2131        let map1 = self;
2132        let map1 = map1.ptr;
2133        let map2 = map2.ptr;
2134        let isl_rs_result = unsafe { isl_map_is_disjoint(map1, map2) };
2135        let isl_rs_result = match isl_rs_result {
2136            0 => false,
2137            1 => true,
2138            _ => panic!("Got isl_bool = -1"),
2139        };
2140        isl_rs_result
2141    }
2142
2143    /// Wraps `isl_map_plain_is_single_valued`.
2144    pub fn plain_is_single_valued(&self) -> bool {
2145        let map = self;
2146        let map = map.ptr;
2147        let isl_rs_result = unsafe { isl_map_plain_is_single_valued(map) };
2148        let isl_rs_result = match isl_rs_result {
2149            0 => false,
2150            1 => true,
2151            _ => panic!("Got isl_bool = -1"),
2152        };
2153        isl_rs_result
2154    }
2155
2156    /// Wraps `isl_map_is_single_valued`.
2157    pub fn is_single_valued(&self) -> bool {
2158        let map = self;
2159        let map = map.ptr;
2160        let isl_rs_result = unsafe { isl_map_is_single_valued(map) };
2161        let isl_rs_result = match isl_rs_result {
2162            0 => false,
2163            1 => true,
2164            _ => panic!("Got isl_bool = -1"),
2165        };
2166        isl_rs_result
2167    }
2168
2169    /// Wraps `isl_map_plain_is_injective`.
2170    pub fn plain_is_injective(&self) -> bool {
2171        let map = self;
2172        let map = map.ptr;
2173        let isl_rs_result = unsafe { isl_map_plain_is_injective(map) };
2174        let isl_rs_result = match isl_rs_result {
2175            0 => false,
2176            1 => true,
2177            _ => panic!("Got isl_bool = -1"),
2178        };
2179        isl_rs_result
2180    }
2181
2182    /// Wraps `isl_map_is_injective`.
2183    pub fn is_injective(&self) -> bool {
2184        let map = self;
2185        let map = map.ptr;
2186        let isl_rs_result = unsafe { isl_map_is_injective(map) };
2187        let isl_rs_result = match isl_rs_result {
2188            0 => false,
2189            1 => true,
2190            _ => panic!("Got isl_bool = -1"),
2191        };
2192        isl_rs_result
2193    }
2194
2195    /// Wraps `isl_map_is_bijective`.
2196    pub fn is_bijective(&self) -> bool {
2197        let map = self;
2198        let map = map.ptr;
2199        let isl_rs_result = unsafe { isl_map_is_bijective(map) };
2200        let isl_rs_result = match isl_rs_result {
2201            0 => false,
2202            1 => true,
2203            _ => panic!("Got isl_bool = -1"),
2204        };
2205        isl_rs_result
2206    }
2207
2208    /// Wraps `isl_map_is_identity`.
2209    pub fn is_identity(&self) -> bool {
2210        let map = self;
2211        let map = map.ptr;
2212        let isl_rs_result = unsafe { isl_map_is_identity(map) };
2213        let isl_rs_result = match isl_rs_result {
2214            0 => false,
2215            1 => true,
2216            _ => panic!("Got isl_bool = -1"),
2217        };
2218        isl_rs_result
2219    }
2220
2221    /// Wraps `isl_map_is_translation`.
2222    pub fn is_translation(&self) -> i32 {
2223        let map = self;
2224        let map = map.ptr;
2225        let isl_rs_result = unsafe { isl_map_is_translation(map) };
2226        isl_rs_result
2227    }
2228
2229    /// Wraps `isl_map_has_equal_space`.
2230    pub fn has_equal_space(&self, map2: &Map) -> bool {
2231        let map1 = self;
2232        let map1 = map1.ptr;
2233        let map2 = map2.ptr;
2234        let isl_rs_result = unsafe { isl_map_has_equal_space(map1, map2) };
2235        let isl_rs_result = match isl_rs_result {
2236            0 => false,
2237            1 => true,
2238            _ => panic!("Got isl_bool = -1"),
2239        };
2240        isl_rs_result
2241    }
2242
2243    /// Wraps `isl_map_can_zip`.
2244    pub fn can_zip(&self) -> bool {
2245        let map = self;
2246        let map = map.ptr;
2247        let isl_rs_result = unsafe { isl_map_can_zip(map) };
2248        let isl_rs_result = match isl_rs_result {
2249            0 => false,
2250            1 => true,
2251            _ => panic!("Got isl_bool = -1"),
2252        };
2253        isl_rs_result
2254    }
2255
2256    /// Wraps `isl_map_zip`.
2257    pub fn zip(self) -> Map {
2258        let map = self;
2259        let mut map = map;
2260        map.do_not_free_on_drop();
2261        let map = map.ptr;
2262        let isl_rs_result = unsafe { isl_map_zip(map) };
2263        let isl_rs_result = Map { ptr: isl_rs_result,
2264                                  should_free_on_drop: true };
2265        isl_rs_result
2266    }
2267
2268    /// Wraps `isl_map_can_curry`.
2269    pub fn can_curry(&self) -> bool {
2270        let map = self;
2271        let map = map.ptr;
2272        let isl_rs_result = unsafe { isl_map_can_curry(map) };
2273        let isl_rs_result = match isl_rs_result {
2274            0 => false,
2275            1 => true,
2276            _ => panic!("Got isl_bool = -1"),
2277        };
2278        isl_rs_result
2279    }
2280
2281    /// Wraps `isl_map_curry`.
2282    pub fn curry(self) -> Map {
2283        let map = self;
2284        let mut map = map;
2285        map.do_not_free_on_drop();
2286        let map = map.ptr;
2287        let isl_rs_result = unsafe { isl_map_curry(map) };
2288        let isl_rs_result = Map { ptr: isl_rs_result,
2289                                  should_free_on_drop: true };
2290        isl_rs_result
2291    }
2292
2293    /// Wraps `isl_map_can_range_curry`.
2294    pub fn can_range_curry(&self) -> bool {
2295        let map = self;
2296        let map = map.ptr;
2297        let isl_rs_result = unsafe { isl_map_can_range_curry(map) };
2298        let isl_rs_result = match isl_rs_result {
2299            0 => false,
2300            1 => true,
2301            _ => panic!("Got isl_bool = -1"),
2302        };
2303        isl_rs_result
2304    }
2305
2306    /// Wraps `isl_map_range_curry`.
2307    pub fn range_curry(self) -> Map {
2308        let map = self;
2309        let mut map = map;
2310        map.do_not_free_on_drop();
2311        let map = map.ptr;
2312        let isl_rs_result = unsafe { isl_map_range_curry(map) };
2313        let isl_rs_result = Map { ptr: isl_rs_result,
2314                                  should_free_on_drop: true };
2315        isl_rs_result
2316    }
2317
2318    /// Wraps `isl_map_can_uncurry`.
2319    pub fn can_uncurry(&self) -> bool {
2320        let map = self;
2321        let map = map.ptr;
2322        let isl_rs_result = unsafe { isl_map_can_uncurry(map) };
2323        let isl_rs_result = match isl_rs_result {
2324            0 => false,
2325            1 => true,
2326            _ => panic!("Got isl_bool = -1"),
2327        };
2328        isl_rs_result
2329    }
2330
2331    /// Wraps `isl_map_uncurry`.
2332    pub fn uncurry(self) -> Map {
2333        let map = self;
2334        let mut map = map;
2335        map.do_not_free_on_drop();
2336        let map = map.ptr;
2337        let isl_rs_result = unsafe { isl_map_uncurry(map) };
2338        let isl_rs_result = Map { ptr: isl_rs_result,
2339                                  should_free_on_drop: true };
2340        isl_rs_result
2341    }
2342
2343    /// Wraps `isl_map_make_disjoint`.
2344    pub fn make_disjoint(self) -> Map {
2345        let map = self;
2346        let mut map = map;
2347        map.do_not_free_on_drop();
2348        let map = map.ptr;
2349        let isl_rs_result = unsafe { isl_map_make_disjoint(map) };
2350        let isl_rs_result = Map { ptr: isl_rs_result,
2351                                  should_free_on_drop: true };
2352        isl_rs_result
2353    }
2354
2355    /// Wraps `isl_map_compute_divs`.
2356    pub fn compute_divs(self) -> Map {
2357        let map = self;
2358        let mut map = map;
2359        map.do_not_free_on_drop();
2360        let map = map.ptr;
2361        let isl_rs_result = unsafe { isl_map_compute_divs(map) };
2362        let isl_rs_result = Map { ptr: isl_rs_result,
2363                                  should_free_on_drop: true };
2364        isl_rs_result
2365    }
2366
2367    /// Wraps `isl_map_align_divs`.
2368    pub fn align_divs(self) -> Map {
2369        let map = self;
2370        let mut map = map;
2371        map.do_not_free_on_drop();
2372        let map = map.ptr;
2373        let isl_rs_result = unsafe { isl_map_align_divs(map) };
2374        let isl_rs_result = Map { ptr: isl_rs_result,
2375                                  should_free_on_drop: true };
2376        isl_rs_result
2377    }
2378
2379    /// Wraps `isl_map_drop_constraints_involving_dims`.
2380    pub fn drop_constraints_involving_dims(self, type_: DimType, first: u32, n: u32) -> Map {
2381        let map = self;
2382        let mut map = map;
2383        map.do_not_free_on_drop();
2384        let map = map.ptr;
2385        let isl_rs_result =
2386            unsafe { isl_map_drop_constraints_involving_dims(map, type_, first, n) };
2387        let isl_rs_result = Map { ptr: isl_rs_result,
2388                                  should_free_on_drop: true };
2389        isl_rs_result
2390    }
2391
2392    /// Wraps `isl_map_drop_constraints_not_involving_dims`.
2393    pub fn drop_constraints_not_involving_dims(self, type_: DimType, first: u32, n: u32) -> Map {
2394        let map = self;
2395        let mut map = map;
2396        map.do_not_free_on_drop();
2397        let map = map.ptr;
2398        let isl_rs_result =
2399            unsafe { isl_map_drop_constraints_not_involving_dims(map, type_, first, n) };
2400        let isl_rs_result = Map { ptr: isl_rs_result,
2401                                  should_free_on_drop: true };
2402        isl_rs_result
2403    }
2404
2405    /// Wraps `isl_map_involves_dims`.
2406    pub fn involves_dims(&self, type_: DimType, first: u32, n: u32) -> bool {
2407        let map = self;
2408        let map = map.ptr;
2409        let isl_rs_result = unsafe { isl_map_involves_dims(map, type_, first, n) };
2410        let isl_rs_result = match isl_rs_result {
2411            0 => false,
2412            1 => true,
2413            _ => panic!("Got isl_bool = -1"),
2414        };
2415        isl_rs_result
2416    }
2417
2418    /// Wraps `isl_map_plain_get_val_if_fixed`.
2419    pub fn plain_get_val_if_fixed(&self, type_: DimType, pos: u32) -> Val {
2420        let map = self;
2421        let map = map.ptr;
2422        let isl_rs_result = unsafe { isl_map_plain_get_val_if_fixed(map, type_, pos) };
2423        let isl_rs_result = Val { ptr: isl_rs_result,
2424                                  should_free_on_drop: true };
2425        isl_rs_result
2426    }
2427
2428    /// Wraps `isl_map_gist`.
2429    pub fn gist(self, context: Map) -> Map {
2430        let map = self;
2431        let mut map = map;
2432        map.do_not_free_on_drop();
2433        let map = map.ptr;
2434        let mut context = context;
2435        context.do_not_free_on_drop();
2436        let context = context.ptr;
2437        let isl_rs_result = unsafe { isl_map_gist(map, context) };
2438        let isl_rs_result = Map { ptr: isl_rs_result,
2439                                  should_free_on_drop: true };
2440        isl_rs_result
2441    }
2442
2443    /// Wraps `isl_map_gist_domain`.
2444    pub fn gist_domain(self, context: Set) -> Map {
2445        let map = self;
2446        let mut map = map;
2447        map.do_not_free_on_drop();
2448        let map = map.ptr;
2449        let mut context = context;
2450        context.do_not_free_on_drop();
2451        let context = context.ptr;
2452        let isl_rs_result = unsafe { isl_map_gist_domain(map, context) };
2453        let isl_rs_result = Map { ptr: isl_rs_result,
2454                                  should_free_on_drop: true };
2455        isl_rs_result
2456    }
2457
2458    /// Wraps `isl_map_gist_range`.
2459    pub fn gist_range(self, context: Set) -> Map {
2460        let map = self;
2461        let mut map = map;
2462        map.do_not_free_on_drop();
2463        let map = map.ptr;
2464        let mut context = context;
2465        context.do_not_free_on_drop();
2466        let context = context.ptr;
2467        let isl_rs_result = unsafe { isl_map_gist_range(map, context) };
2468        let isl_rs_result = Map { ptr: isl_rs_result,
2469                                  should_free_on_drop: true };
2470        isl_rs_result
2471    }
2472
2473    /// Wraps `isl_map_gist_params`.
2474    pub fn gist_params(self, context: Set) -> Map {
2475        let map = self;
2476        let mut map = map;
2477        map.do_not_free_on_drop();
2478        let map = map.ptr;
2479        let mut context = context;
2480        context.do_not_free_on_drop();
2481        let context = context.ptr;
2482        let isl_rs_result = unsafe { isl_map_gist_params(map, context) };
2483        let isl_rs_result = Map { ptr: isl_rs_result,
2484                                  should_free_on_drop: true };
2485        isl_rs_result
2486    }
2487
2488    /// Wraps `isl_map_gist_basic_map`.
2489    pub fn gist_basic_map(self, context: BasicMap) -> Map {
2490        let map = self;
2491        let mut map = map;
2492        map.do_not_free_on_drop();
2493        let map = map.ptr;
2494        let mut context = context;
2495        context.do_not_free_on_drop();
2496        let context = context.ptr;
2497        let isl_rs_result = unsafe { isl_map_gist_basic_map(map, context) };
2498        let isl_rs_result = Map { ptr: isl_rs_result,
2499                                  should_free_on_drop: true };
2500        isl_rs_result
2501    }
2502
2503    /// Wraps `isl_map_get_range_stride_info`.
2504    pub fn get_range_stride_info(&self, pos: i32) -> StrideInfo {
2505        let map = self;
2506        let map = map.ptr;
2507        let isl_rs_result = unsafe { isl_map_get_range_stride_info(map, pos) };
2508        let isl_rs_result = StrideInfo { ptr: isl_rs_result,
2509                                         should_free_on_drop: true };
2510        isl_rs_result
2511    }
2512
2513    /// Wraps `isl_map_get_range_lattice_tile`.
2514    pub fn get_range_lattice_tile(&self) -> FixedBox {
2515        let map = self;
2516        let map = map.ptr;
2517        let isl_rs_result = unsafe { isl_map_get_range_lattice_tile(map) };
2518        let isl_rs_result = FixedBox { ptr: isl_rs_result,
2519                                       should_free_on_drop: true };
2520        isl_rs_result
2521    }
2522
2523    /// Wraps `isl_map_get_range_simple_fixed_box_hull`.
2524    pub fn get_range_simple_fixed_box_hull(&self) -> FixedBox {
2525        let map = self;
2526        let map = map.ptr;
2527        let isl_rs_result = unsafe { isl_map_get_range_simple_fixed_box_hull(map) };
2528        let isl_rs_result = FixedBox { ptr: isl_rs_result,
2529                                       should_free_on_drop: true };
2530        isl_rs_result
2531    }
2532
2533    /// Wraps `isl_map_coalesce`.
2534    pub fn coalesce(self) -> Map {
2535        let map = self;
2536        let mut map = map;
2537        map.do_not_free_on_drop();
2538        let map = map.ptr;
2539        let isl_rs_result = unsafe { isl_map_coalesce(map) };
2540        let isl_rs_result = Map { ptr: isl_rs_result,
2541                                  should_free_on_drop: true };
2542        isl_rs_result
2543    }
2544
2545    /// Wraps `isl_map_plain_is_equal`.
2546    pub fn plain_is_equal(&self, map2: &Map) -> bool {
2547        let map1 = self;
2548        let map1 = map1.ptr;
2549        let map2 = map2.ptr;
2550        let isl_rs_result = unsafe { isl_map_plain_is_equal(map1, map2) };
2551        let isl_rs_result = match isl_rs_result {
2552            0 => false,
2553            1 => true,
2554            _ => panic!("Got isl_bool = -1"),
2555        };
2556        isl_rs_result
2557    }
2558
2559    /// Wraps `isl_map_get_hash`.
2560    pub fn get_hash(&self) -> u32 {
2561        let map = self;
2562        let map = map.ptr;
2563        let isl_rs_result = unsafe { isl_map_get_hash(map) };
2564        isl_rs_result
2565    }
2566
2567    /// Wraps `isl_map_n_basic_map`.
2568    pub fn n_basic_map(&self) -> i32 {
2569        let map = self;
2570        let map = map.ptr;
2571        let isl_rs_result = unsafe { isl_map_n_basic_map(map) };
2572        isl_rs_result
2573    }
2574
2575    /// Wraps `isl_map_fixed_power_val`.
2576    pub fn fixed_power_val(self, exp: Val) -> Map {
2577        let map = self;
2578        let mut map = map;
2579        map.do_not_free_on_drop();
2580        let map = map.ptr;
2581        let mut exp = exp;
2582        exp.do_not_free_on_drop();
2583        let exp = exp.ptr;
2584        let isl_rs_result = unsafe { isl_map_fixed_power_val(map, exp) };
2585        let isl_rs_result = Map { ptr: isl_rs_result,
2586                                  should_free_on_drop: true };
2587        isl_rs_result
2588    }
2589
2590    /// Wraps `isl_map_lex_le_map`.
2591    pub fn lex_le_map(self, map2: Map) -> Map {
2592        let map1 = self;
2593        let mut map1 = map1;
2594        map1.do_not_free_on_drop();
2595        let map1 = map1.ptr;
2596        let mut map2 = map2;
2597        map2.do_not_free_on_drop();
2598        let map2 = map2.ptr;
2599        let isl_rs_result = unsafe { isl_map_lex_le_map(map1, map2) };
2600        let isl_rs_result = Map { ptr: isl_rs_result,
2601                                  should_free_on_drop: true };
2602        isl_rs_result
2603    }
2604
2605    /// Wraps `isl_map_lex_lt_map`.
2606    pub fn lex_lt_map(self, map2: Map) -> Map {
2607        let map1 = self;
2608        let mut map1 = map1;
2609        map1.do_not_free_on_drop();
2610        let map1 = map1.ptr;
2611        let mut map2 = map2;
2612        map2.do_not_free_on_drop();
2613        let map2 = map2.ptr;
2614        let isl_rs_result = unsafe { isl_map_lex_lt_map(map1, map2) };
2615        let isl_rs_result = Map { ptr: isl_rs_result,
2616                                  should_free_on_drop: true };
2617        isl_rs_result
2618    }
2619
2620    /// Wraps `isl_map_lex_ge_map`.
2621    pub fn lex_ge_map(self, map2: Map) -> Map {
2622        let map1 = self;
2623        let mut map1 = map1;
2624        map1.do_not_free_on_drop();
2625        let map1 = map1.ptr;
2626        let mut map2 = map2;
2627        map2.do_not_free_on_drop();
2628        let map2 = map2.ptr;
2629        let isl_rs_result = unsafe { isl_map_lex_ge_map(map1, map2) };
2630        let isl_rs_result = Map { ptr: isl_rs_result,
2631                                  should_free_on_drop: true };
2632        isl_rs_result
2633    }
2634
2635    /// Wraps `isl_map_lex_gt_map`.
2636    pub fn lex_gt_map(self, map2: Map) -> Map {
2637        let map1 = self;
2638        let mut map1 = map1;
2639        map1.do_not_free_on_drop();
2640        let map1 = map1.ptr;
2641        let mut map2 = map2;
2642        map2.do_not_free_on_drop();
2643        let map2 = map2.ptr;
2644        let isl_rs_result = unsafe { isl_map_lex_gt_map(map1, map2) };
2645        let isl_rs_result = Map { ptr: isl_rs_result,
2646                                  should_free_on_drop: true };
2647        isl_rs_result
2648    }
2649
2650    /// Wraps `isl_map_align_params`.
2651    pub fn align_params(self, model: Space) -> Map {
2652        let map = self;
2653        let mut map = map;
2654        map.do_not_free_on_drop();
2655        let map = map.ptr;
2656        let mut model = model;
2657        model.do_not_free_on_drop();
2658        let model = model.ptr;
2659        let isl_rs_result = unsafe { isl_map_align_params(map, model) };
2660        let isl_rs_result = Map { ptr: isl_rs_result,
2661                                  should_free_on_drop: true };
2662        isl_rs_result
2663    }
2664
2665    /// Wraps `isl_map_drop_unused_params`.
2666    pub fn drop_unused_params(self) -> Map {
2667        let map = self;
2668        let mut map = map;
2669        map.do_not_free_on_drop();
2670        let map = map.ptr;
2671        let isl_rs_result = unsafe { isl_map_drop_unused_params(map) };
2672        let isl_rs_result = Map { ptr: isl_rs_result,
2673                                  should_free_on_drop: true };
2674        isl_rs_result
2675    }
2676
2677    /// Wraps `isl_map_from_aff`.
2678    pub fn from_aff(aff: Aff) -> Map {
2679        let mut aff = aff;
2680        aff.do_not_free_on_drop();
2681        let aff = aff.ptr;
2682        let isl_rs_result = unsafe { isl_map_from_aff(aff) };
2683        let isl_rs_result = Map { ptr: isl_rs_result,
2684                                  should_free_on_drop: true };
2685        isl_rs_result
2686    }
2687
2688    /// Wraps `isl_map_dim_min`.
2689    pub fn dim_min(self, pos: i32) -> PwAff {
2690        let map = self;
2691        let mut map = map;
2692        map.do_not_free_on_drop();
2693        let map = map.ptr;
2694        let isl_rs_result = unsafe { isl_map_dim_min(map, pos) };
2695        let isl_rs_result = PwAff { ptr: isl_rs_result,
2696                                    should_free_on_drop: true };
2697        isl_rs_result
2698    }
2699
2700    /// Wraps `isl_map_dim_max`.
2701    pub fn dim_max(self, pos: i32) -> PwAff {
2702        let map = self;
2703        let mut map = map;
2704        map.do_not_free_on_drop();
2705        let map = map.ptr;
2706        let isl_rs_result = unsafe { isl_map_dim_max(map, pos) };
2707        let isl_rs_result = PwAff { ptr: isl_rs_result,
2708                                    should_free_on_drop: true };
2709        isl_rs_result
2710    }
2711
2712    /// Does not call isl_xxx_free() on being dropped. (For internal use only.)
2713    pub fn do_not_free_on_drop(&mut self) {
2714        self.should_free_on_drop = false;
2715    }
2716}
2717
2718impl Drop for Map {
2719    fn drop(&mut self) {
2720        if self.should_free_on_drop {
2721            unsafe {
2722                isl_map_free(self.ptr);
2723            }
2724        }
2725    }
2726}