2 * Copyright 2010 INRIA Saclay
3 * Copyright 2014 Ecole Normale Superieure
4 * Copyright 2014 INRIA Rocquencourt
6 * Use of this software is governed by the MIT license
8 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
9 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
11 * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
12 * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
13 * B.P. 105 - 78153 Le Chesnay, France
20 #include <isl/union_set.h>
21 #include <isl/union_map.h>
22 #include <isl/polynomial.h>
23 #include <isl/schedule.h>
26 static void *isl_obj_val_copy(void *v
)
28 return isl_val_copy((isl_val
*)v
);
31 static void isl_obj_val_free(void *v
)
33 isl_val_free((isl_val
*)v
);
36 static __isl_give isl_printer
*isl_obj_val_print(__isl_take isl_printer
*p
,
39 return isl_printer_print_val(p
, (isl_val
*)v
);
42 static void *isl_obj_val_add(void *v1
, void *v2
)
44 return isl_val_add((isl_val
*) v1
, (isl_val
*) v2
);
47 struct isl_obj_vtable isl_obj_val_vtable
= {
54 static void *isl_obj_map_copy(void *v
)
56 return isl_map_copy((struct isl_map
*)v
);
59 static void isl_obj_map_free(void *v
)
61 isl_map_free((struct isl_map
*)v
);
64 static __isl_give isl_printer
*isl_obj_map_print(__isl_take isl_printer
*p
,
67 return isl_printer_print_map(p
, (struct isl_map
*)v
);
70 static void *isl_obj_map_add(void *v1
, void *v2
)
72 return isl_map_union((struct isl_map
*)v1
, (struct isl_map
*)v2
);
75 struct isl_obj_vtable isl_obj_map_vtable
= {
82 static void *isl_obj_union_map_copy(void *v
)
84 return isl_union_map_copy((isl_union_map
*)v
);
87 static void isl_obj_union_map_free(void *v
)
89 isl_union_map_free((isl_union_map
*)v
);
92 static __isl_give isl_printer
*isl_obj_union_map_print(__isl_take isl_printer
*p
,
95 return isl_printer_print_union_map(p
, (isl_union_map
*)v
);
98 static void *isl_obj_union_map_add(void *v1
, void *v2
)
100 return isl_union_map_union((isl_union_map
*)v1
, (isl_union_map
*)v2
);
103 struct isl_obj_vtable isl_obj_union_map_vtable
= {
104 isl_obj_union_map_copy
,
105 isl_obj_union_map_add
,
106 isl_obj_union_map_print
,
107 isl_obj_union_map_free
110 static void *isl_obj_set_copy(void *v
)
112 return isl_set_copy((struct isl_set
*)v
);
115 static void isl_obj_set_free(void *v
)
117 isl_set_free((struct isl_set
*)v
);
120 static __isl_give isl_printer
*isl_obj_set_print(__isl_take isl_printer
*p
,
123 return isl_printer_print_set(p
, (struct isl_set
*)v
);
126 static void *isl_obj_set_add(void *v1
, void *v2
)
128 return isl_set_union((struct isl_set
*)v1
, (struct isl_set
*)v2
);
131 struct isl_obj_vtable isl_obj_set_vtable
= {
138 static void *isl_obj_union_set_copy(void *v
)
140 return isl_union_set_copy((isl_union_set
*)v
);
143 static void isl_obj_union_set_free(void *v
)
145 isl_union_set_free((isl_union_set
*)v
);
148 static __isl_give isl_printer
*isl_obj_union_set_print(__isl_take isl_printer
*p
,
151 return isl_printer_print_union_set(p
, (isl_union_set
*)v
);
154 static void *isl_obj_union_set_add(void *v1
, void *v2
)
156 return isl_union_set_union((isl_union_set
*)v1
, (isl_union_set
*)v2
);
159 struct isl_obj_vtable isl_obj_union_set_vtable
= {
160 isl_obj_union_set_copy
,
161 isl_obj_union_set_add
,
162 isl_obj_union_set_print
,
163 isl_obj_union_set_free
166 static void *isl_obj_pw_multi_aff_copy(void *v
)
168 return isl_pw_multi_aff_copy((isl_pw_multi_aff
*) v
);
171 static void isl_obj_pw_multi_aff_free(void *v
)
173 isl_pw_multi_aff_free((isl_pw_multi_aff
*) v
);
176 static __isl_give isl_printer
*isl_obj_pw_multi_aff_print(
177 __isl_take isl_printer
*p
, void *v
)
179 return isl_printer_print_pw_multi_aff(p
, (isl_pw_multi_aff
*) v
);
182 static void *isl_obj_pw_multi_aff_add(void *v1
, void *v2
)
184 return isl_pw_multi_aff_add((isl_pw_multi_aff
*) v1
,
185 (isl_pw_multi_aff
*) v2
);
188 struct isl_obj_vtable isl_obj_pw_multi_aff_vtable
= {
189 isl_obj_pw_multi_aff_copy
,
190 isl_obj_pw_multi_aff_add
,
191 isl_obj_pw_multi_aff_print
,
192 isl_obj_pw_multi_aff_free
195 static void *isl_obj_none_copy(void *v
)
200 static void isl_obj_none_free(void *v
)
204 static __isl_give isl_printer
*isl_obj_none_print(__isl_take isl_printer
*p
,
210 static void *isl_obj_none_add(void *v1
, void *v2
)
215 struct isl_obj_vtable isl_obj_none_vtable
= {
222 static void *isl_obj_pw_qp_copy(void *v
)
224 return isl_pw_qpolynomial_copy((struct isl_pw_qpolynomial
*)v
);
227 static void isl_obj_pw_qp_free(void *v
)
229 isl_pw_qpolynomial_free((struct isl_pw_qpolynomial
*)v
);
232 static __isl_give isl_printer
*isl_obj_pw_qp_print(__isl_take isl_printer
*p
,
235 return isl_printer_print_pw_qpolynomial(p
,
236 (struct isl_pw_qpolynomial
*)v
);
239 static void *isl_obj_pw_qp_add(void *v1
, void *v2
)
241 return isl_pw_qpolynomial_add((struct isl_pw_qpolynomial
*)v1
,
242 (struct isl_pw_qpolynomial
*)v2
);
245 struct isl_obj_vtable isl_obj_pw_qpolynomial_vtable
= {
252 static void *isl_obj_union_pw_qp_copy(void *v
)
254 return isl_union_pw_qpolynomial_copy((struct isl_union_pw_qpolynomial
*)v
);
257 static void isl_obj_union_pw_qp_free(void *v
)
259 isl_union_pw_qpolynomial_free((struct isl_union_pw_qpolynomial
*)v
);
262 static __isl_give isl_printer
*isl_obj_union_pw_qp_print(
263 __isl_take isl_printer
*p
, void *v
)
265 return isl_printer_print_union_pw_qpolynomial(p
,
266 (struct isl_union_pw_qpolynomial
*)v
);
269 static void *isl_obj_union_pw_qp_add(void *v1
, void *v2
)
271 return isl_union_pw_qpolynomial_add(
272 (struct isl_union_pw_qpolynomial
*)v1
,
273 (struct isl_union_pw_qpolynomial
*)v2
);
276 struct isl_obj_vtable isl_obj_union_pw_qpolynomial_vtable
= {
277 isl_obj_union_pw_qp_copy
,
278 isl_obj_union_pw_qp_add
,
279 isl_obj_union_pw_qp_print
,
280 isl_obj_union_pw_qp_free
283 static void *isl_obj_pw_qpf_copy(void *v
)
285 return isl_pw_qpolynomial_fold_copy((struct isl_pw_qpolynomial_fold
*)v
);
288 static void isl_obj_pw_qpf_free(void *v
)
290 isl_pw_qpolynomial_fold_free((struct isl_pw_qpolynomial_fold
*)v
);
293 static __isl_give isl_printer
*isl_obj_pw_qpf_print(__isl_take isl_printer
*p
,
296 return isl_printer_print_pw_qpolynomial_fold(p
,
297 (struct isl_pw_qpolynomial_fold
*)v
);
300 static void *isl_obj_pw_qpf_add(void *v1
, void *v2
)
302 return isl_pw_qpolynomial_fold_fold((struct isl_pw_qpolynomial_fold
*)v1
,
303 (struct isl_pw_qpolynomial_fold
*)v2
);
306 struct isl_obj_vtable isl_obj_pw_qpolynomial_fold_vtable
= {
309 isl_obj_pw_qpf_print
,
313 static void *isl_obj_union_pw_qpf_copy(void *v
)
315 return isl_union_pw_qpolynomial_fold_copy((struct isl_union_pw_qpolynomial_fold
*)v
);
318 static void isl_obj_union_pw_qpf_free(void *v
)
320 isl_union_pw_qpolynomial_fold_free((struct isl_union_pw_qpolynomial_fold
*)v
);
323 static __isl_give isl_printer
*isl_obj_union_pw_qpf_print(
324 __isl_take isl_printer
*p
, void *v
)
326 return isl_printer_print_union_pw_qpolynomial_fold(p
,
327 (struct isl_union_pw_qpolynomial_fold
*)v
);
330 static void *isl_obj_union_pw_qpf_add(void *v1
, void *v2
)
332 return isl_union_pw_qpolynomial_fold_fold(
333 (struct isl_union_pw_qpolynomial_fold
*)v1
,
334 (struct isl_union_pw_qpolynomial_fold
*)v2
);
337 struct isl_obj_vtable isl_obj_union_pw_qpolynomial_fold_vtable
= {
338 isl_obj_union_pw_qpf_copy
,
339 isl_obj_union_pw_qpf_add
,
340 isl_obj_union_pw_qpf_print
,
341 isl_obj_union_pw_qpf_free
344 static void *isl_obj_schedule_copy(void *v
)
346 return isl_schedule_copy((isl_schedule
*) v
);
349 static void isl_obj_schedule_free(void *v
)
351 isl_schedule_free((isl_schedule
*) v
);
354 static __isl_give isl_printer
*isl_obj_schedule_print(
355 __isl_take isl_printer
*p
, void *v
)
357 return isl_printer_print_schedule(p
, (isl_schedule
*) v
);
360 struct isl_obj_vtable isl_obj_schedule_vtable
= {
361 isl_obj_schedule_copy
,
363 isl_obj_schedule_print
,
364 isl_obj_schedule_free