add isl_obj_pw_qpolynomial_fold
[isl.git] / isl_obj.c
bloba3026b6c25e44a6733fff5cec5ebc554e09f8ceb
1 /*
2 * Copyright 2010 INRIA Saclay
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8 * 91893 Orsay, France
9 */
11 #include <isl_obj.h>
13 static void *isl_obj_map_copy(void *v)
15 return isl_map_copy((struct isl_map *)v);
18 static void isl_obj_map_free(void *v)
20 isl_map_free((struct isl_map *)v);
23 static void isl_obj_map_print(void *v, FILE *out)
25 isl_map_print((struct isl_map *)v, out, 0, ISL_FORMAT_ISL);
28 static void *isl_obj_map_add(void *v1, void *v2)
30 return isl_map_union((struct isl_map *)v1, (struct isl_map *)v2);
33 struct isl_obj_vtable isl_obj_map_vtable = {
34 isl_obj_map_copy,
35 isl_obj_map_add,
36 isl_obj_map_print,
37 isl_obj_map_free
40 static void *isl_obj_set_copy(void *v)
42 return isl_set_copy((struct isl_set *)v);
45 static void isl_obj_set_free(void *v)
47 isl_set_free((struct isl_set *)v);
50 static void isl_obj_set_print(void *v, FILE *out)
52 isl_set_print((struct isl_set *)v, out, 0, ISL_FORMAT_ISL);
55 static void *isl_obj_set_add(void *v1, void *v2)
57 return isl_set_union((struct isl_set *)v1, (struct isl_set *)v2);
60 struct isl_obj_vtable isl_obj_set_vtable = {
61 isl_obj_set_copy,
62 isl_obj_set_add,
63 isl_obj_set_print,
64 isl_obj_set_free
67 static void *isl_obj_none_copy(void *v)
69 return v;
72 static void isl_obj_none_free(void *v)
76 static void isl_obj_none_print(void *v, FILE *out)
80 static void *isl_obj_none_add(void *v1, void *v2)
84 static struct isl_obj_vtable obj_none = {
85 isl_obj_none_copy,
86 isl_obj_none_add,
87 isl_obj_none_print,
88 isl_obj_none_free
90 isl_obj_type isl_obj_none = &obj_none;
92 static void *isl_obj_pw_qp_copy(void *v)
94 return isl_pw_qpolynomial_copy((struct isl_pw_qpolynomial *)v);
97 static void isl_obj_pw_qp_free(void *v)
99 isl_pw_qpolynomial_free((struct isl_pw_qpolynomial *)v);
102 static void isl_obj_pw_qp_print(void *v, FILE *out)
104 isl_pw_qpolynomial_print((struct isl_pw_qpolynomial *)v, out,
105 ISL_FORMAT_ISL);
108 static void *isl_obj_pw_qp_add(void *v1, void *v2)
110 return isl_pw_qpolynomial_add((struct isl_pw_qpolynomial *)v1,
111 (struct isl_pw_qpolynomial *)v2);
114 struct isl_obj_vtable isl_obj_pw_qpolynomial_vtable = {
115 isl_obj_pw_qp_copy,
116 isl_obj_pw_qp_add,
117 isl_obj_pw_qp_print,
118 isl_obj_pw_qp_free
121 static void *isl_obj_pw_qpf_copy(void *v)
123 return isl_pw_qpolynomial_fold_copy((struct isl_pw_qpolynomial_fold *)v);
126 static void isl_obj_pw_qpf_free(void *v)
128 isl_pw_qpolynomial_fold_free((struct isl_pw_qpolynomial_fold *)v);
131 static void isl_obj_pw_qpf_print(void *v, FILE *out)
133 isl_pw_qpolynomial_fold_print((struct isl_pw_qpolynomial_fold *)v, out,
134 ISL_FORMAT_ISL);
137 static void *isl_obj_pw_qpf_add(void *v1, void *v2)
139 return isl_pw_qpolynomial_fold_add((struct isl_pw_qpolynomial_fold *)v1,
140 (struct isl_pw_qpolynomial_fold *)v2);
143 struct isl_obj_vtable isl_obj_pw_qpolynomial_fold_vtable = {
144 isl_obj_pw_qpf_copy,
145 isl_obj_pw_qpf_add,
146 isl_obj_pw_qpf_print,
147 isl_obj_pw_qpf_free