doc: document setting and getting of dimension names
[isl.git] / isl_obj.c
blob137930d06a706143a01fb7001558c334b2ab2afa
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 __isl_give isl_printer *isl_obj_map_print(__isl_take isl_printer *p,
24 void *v)
26 return isl_printer_print_map(p, (struct isl_map *)v);
29 static void *isl_obj_map_add(void *v1, void *v2)
31 return isl_map_union((struct isl_map *)v1, (struct isl_map *)v2);
34 struct isl_obj_vtable isl_obj_map_vtable = {
35 isl_obj_map_copy,
36 isl_obj_map_add,
37 isl_obj_map_print,
38 isl_obj_map_free
41 static void *isl_obj_set_copy(void *v)
43 return isl_set_copy((struct isl_set *)v);
46 static void isl_obj_set_free(void *v)
48 isl_set_free((struct isl_set *)v);
51 static __isl_give isl_printer *isl_obj_set_print(__isl_take isl_printer *p,
52 void *v)
54 return isl_printer_print_set(p, (struct isl_set *)v);
57 static void *isl_obj_set_add(void *v1, void *v2)
59 return isl_set_union((struct isl_set *)v1, (struct isl_set *)v2);
62 struct isl_obj_vtable isl_obj_set_vtable = {
63 isl_obj_set_copy,
64 isl_obj_set_add,
65 isl_obj_set_print,
66 isl_obj_set_free
69 static void *isl_obj_none_copy(void *v)
71 return v;
74 static void isl_obj_none_free(void *v)
78 static __isl_give isl_printer *isl_obj_none_print(__isl_take isl_printer *p,
79 void *v)
81 return p;
84 static void *isl_obj_none_add(void *v1, void *v2)
88 static struct isl_obj_vtable obj_none = {
89 isl_obj_none_copy,
90 isl_obj_none_add,
91 isl_obj_none_print,
92 isl_obj_none_free
94 isl_obj_type isl_obj_none = &obj_none;
96 static void *isl_obj_pw_qp_copy(void *v)
98 return isl_pw_qpolynomial_copy((struct isl_pw_qpolynomial *)v);
101 static void isl_obj_pw_qp_free(void *v)
103 isl_pw_qpolynomial_free((struct isl_pw_qpolynomial *)v);
106 static __isl_give isl_printer *isl_obj_pw_qp_print(__isl_take isl_printer *p,
107 void *v)
109 return isl_printer_print_pw_qpolynomial(p,
110 (struct isl_pw_qpolynomial *)v);
113 static void *isl_obj_pw_qp_add(void *v1, void *v2)
115 return isl_pw_qpolynomial_add((struct isl_pw_qpolynomial *)v1,
116 (struct isl_pw_qpolynomial *)v2);
119 struct isl_obj_vtable isl_obj_pw_qpolynomial_vtable = {
120 isl_obj_pw_qp_copy,
121 isl_obj_pw_qp_add,
122 isl_obj_pw_qp_print,
123 isl_obj_pw_qp_free
126 static void *isl_obj_pw_qpf_copy(void *v)
128 return isl_pw_qpolynomial_fold_copy((struct isl_pw_qpolynomial_fold *)v);
131 static void isl_obj_pw_qpf_free(void *v)
133 isl_pw_qpolynomial_fold_free((struct isl_pw_qpolynomial_fold *)v);
136 static __isl_give isl_printer *isl_obj_pw_qpf_print(__isl_take isl_printer *p,
137 void *v)
139 return isl_printer_print_pw_qpolynomial_fold(p,
140 (struct isl_pw_qpolynomial_fold *)v);
143 static void *isl_obj_pw_qpf_add(void *v1, void *v2)
145 return isl_pw_qpolynomial_fold_add((struct isl_pw_qpolynomial_fold *)v1,
146 (struct isl_pw_qpolynomial_fold *)v2);
149 struct isl_obj_vtable isl_obj_pw_qpolynomial_fold_vtable = {
150 isl_obj_pw_qpf_copy,
151 isl_obj_pw_qpf_add,
152 isl_obj_pw_qpf_print,
153 isl_obj_pw_qpf_free