A set only has a "range", so we should only compute the product of
that range and not of the domain.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
*/
struct isl_set *isl_set_product(struct isl_set *set1, struct isl_set *set2)
{
- return (struct isl_set *)isl_map_product((struct isl_map *)set1,
- (struct isl_map *)set2);
+ return isl_map_range_product(set1, set2);
}
__isl_give isl_set *isl_set_flat_product(__isl_take isl_set *set1,
return 0;
}
+int test_product(isl_ctx *ctx)
+{
+ const char *str;
+ isl_set *set;
+ int ok;
+
+ str = "{ A[i] }";
+ set = isl_set_read_from_str(ctx, str, -1);
+ set = isl_set_product(set, isl_set_copy(set));
+ ok = isl_set_is_wrapping(set);
+ isl_set_free(set);
+ if (ok < 0)
+ return -1;
+ if (!ok)
+ isl_die(ctx, isl_error_unknown, "unexpected result", return -1);
+
+ return 0;
+}
+
int main()
{
struct isl_ctx *ctx;
assert(srcdir);
ctx = isl_ctx_alloc();
+ if (test_product(ctx) < 0)
+ goto error;
if (test_dim_max(ctx) < 0)
goto error;
if (test_aff(ctx) < 0)