int isl_space_is_set(__isl_keep isl_space *space);
int isl_space_is_map(__isl_keep isl_space *space);
-Spaces can be compared using the following function:
+Spaces can be compared using the following functions:
#include <isl/space.h>
int isl_space_is_equal(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
+ int isl_space_is_domain(__isl_keep isl_space *space1,
+ __isl_keep isl_space *space2);
+
+C<isl_space_is_domain> checks whether the first argument is equal
+to the domain of the second argument. This requires in particular that
+the first argument is a set space and that the second argument
+is a map space.
It is often useful to create objects that live in the
same space as some other object. This can be accomplished
int isl_space_can_curry(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_curry(__isl_take isl_space *space);
+int isl_space_is_domain(__isl_keep isl_space *space1,
+ __isl_keep isl_space *space2);
int isl_space_is_equal(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
int isl_space_match(__isl_keep isl_space *dim1, enum isl_dim_type dim1_type,
goto error;
ctx = isl_point_get_ctx(pnt);
pnt_dim = isl_point_get_space(pnt);
- isl_assert(ctx, isl_space_is_domain(pnt_dim, pw->dim), goto error);
+ isl_assert(ctx, isl_space_is_domain_internal(pnt_dim, pw->dim),
+ goto error);
for (i = 0; i < pw->n; ++i) {
found = isl_set_contains_point(pw->p[i].set, pnt);
goto error;
ctx = isl_space_get_ctx(pw->dim);
- isl_assert(ctx, isl_space_is_domain(morph->dom->dim, pw->dim),
+ isl_assert(ctx, isl_space_is_domain_internal(morph->dom->dim, pw->dim),
goto error);
pw = FN(PW,cow)(pw);
}
/* Is space1 equal to the domain of space2?
+ *
+ * In the internal version we also allow space2 to be the space of a set,
+ * provided space1 is a parameter space.
*/
-int isl_space_is_domain(__isl_keep isl_space *space1,
+int isl_space_is_domain_internal(__isl_keep isl_space *space1,
__isl_keep isl_space *space2)
{
if (!space1 || !space2)
isl_space_tuple_match(space1, isl_dim_set, space2, isl_dim_in);
}
+/* Is space1 equal to the domain of space2?
+ */
+int isl_space_is_domain(__isl_keep isl_space *space1,
+ __isl_keep isl_space *space2)
+{
+ if (!space2)
+ return -1;
+ if (!isl_space_is_map(space2))
+ return 0;
+ return isl_space_is_domain_internal(space1, space2);
+}
+
int isl_space_compatible(__isl_keep isl_space *dim1,
__isl_keep isl_space *dim2)
{
uint32_t isl_space_get_hash(__isl_keep isl_space *dim);
-int isl_space_is_domain(__isl_keep isl_space *space1,
+int isl_space_is_domain_internal(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
__isl_give isl_space *isl_space_as_set_space(__isl_take isl_space *dim);