2 * Copyright 2011 Sven Verdoolaege
3 * Copyright 2012-2013 Ecole Normale Superieure
5 * Use of this software is governed by the MIT license
7 * Written by Sven Verdoolaege,
8 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
11 #include <isl/space.h>
13 #include <isl_multi_macro.h>
15 const char *FN(MULTI(BASE
),get_tuple_name
)(__isl_keep
MULTI(BASE
) *multi
,
16 enum isl_dim_type type
)
18 return multi
? isl_space_get_tuple_name(multi
->space
, type
) : NULL
;
21 /* Does the specified tuple have an id?
23 isl_bool
FN(MULTI(BASE
),has_tuple_id
)(__isl_keep
MULTI(BASE
) *multi
,
24 enum isl_dim_type type
)
27 return isl_bool_error
;
28 return isl_space_has_tuple_id(multi
->space
, type
);
31 /* Return the id of the specified tuple.
33 __isl_give isl_id
*FN(MULTI(BASE
),get_tuple_id
)(__isl_keep
MULTI(BASE
) *multi
,
34 enum isl_dim_type type
)
36 return multi
? isl_space_get_tuple_id(multi
->space
, type
) : NULL
;
39 __isl_give
MULTI(BASE
) *FN(MULTI(BASE
),set_tuple_name
)(
40 __isl_keep
MULTI(BASE
) *multi
, enum isl_dim_type type
,
45 multi
= FN(MULTI(BASE
),cow
)(multi
);
49 space
= FN(MULTI(BASE
),get_space
)(multi
);
50 space
= isl_space_set_tuple_name(space
, type
, s
);
52 return FN(MULTI(BASE
),reset_space
)(multi
, space
);
55 __isl_give
MULTI(BASE
) *FN(MULTI(BASE
),set_tuple_id
)(
56 __isl_take
MULTI(BASE
) *multi
, enum isl_dim_type type
,
57 __isl_take isl_id
*id
)
61 multi
= FN(MULTI(BASE
),cow
)(multi
);
65 space
= FN(MULTI(BASE
),get_space
)(multi
);
66 space
= isl_space_set_tuple_id(space
, type
, id
);
68 return FN(MULTI(BASE
),reset_space
)(multi
, space
);
74 /* Drop the id on the specified tuple.
76 __isl_give
MULTI(BASE
) *FN(MULTI(BASE
),reset_tuple_id
)(
77 __isl_take
MULTI(BASE
) *multi
, enum isl_dim_type type
)
83 if (!FN(MULTI(BASE
),has_tuple_id
)(multi
, type
))
86 multi
= FN(MULTI(BASE
),cow
)(multi
);
90 space
= FN(MULTI(BASE
),get_space
)(multi
);
91 space
= isl_space_reset_tuple_id(space
, type
);
93 return FN(MULTI(BASE
),reset_space
)(multi
, space
);