+void test_factorize(isl_ctx *ctx)
+{
+ const char *str;
+ isl_basic_set *bset;
+ isl_factorizer *f;
+
+ str = "{ [i0, i1, i2, i3, i4, i5, i6, i7] : 3i5 <= 2 - 2i0 and "
+ "i0 >= -2 and i6 >= 1 + i3 and i7 >= 0 and 3i5 >= -2i0 and "
+ "2i4 <= i2 and i6 >= 1 + 2i0 + 3i1 and i4 <= -1 and "
+ "i6 >= 1 + 2i0 + 3i5 and i6 <= 2 + 2i0 + 3i5 and "
+ "3i5 <= 2 - 2i0 - i2 + 3i4 and i6 <= 2 + 2i0 + 3i1 and "
+ "i0 <= -1 and i7 <= i2 + i3 - 3i4 - i6 and "
+ "3i5 >= -2i0 - i2 + 3i4 }";
+ bset = isl_basic_set_read_from_str(ctx, str, 0);
+ f = isl_basic_set_factorizer(bset);
+ assert(f);
+ isl_basic_set_free(bset);
+ isl_factorizer_free(f);
+
+ str = "{ [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12] : "
+ "i12 <= 2 + i0 - i11 and 2i8 >= -i4 and i11 >= i1 and "
+ "3i5 <= -i2 and 2i11 >= -i4 - 2i7 and i11 <= 3 + i0 + 3i9 and "
+ "i11 <= -i4 - 2i7 and i12 >= -i10 and i2 >= -2 and "
+ "i11 >= i1 + 3i10 and i11 >= 1 + i0 + 3i9 and "
+ "i11 <= 1 - i4 - 2i8 and 6i6 <= 6 - i2 and 3i6 >= 1 - i2 and "
+ "i11 <= 2 + i1 and i12 <= i4 + i11 and i12 >= i0 - i11 and "
+ "3i5 >= -2 - i2 and i12 >= -1 + i4 + i11 and 3i3 <= 3 - i2 and "
+ "9i6 <= 11 - i2 + 6i5 and 3i3 >= 1 - i2 and "
+ "9i6 <= 5 - i2 + 6i3 and i12 <= -1 and i2 <= 0 }";
+ bset = isl_basic_set_read_from_str(ctx, str, 0);
+ f = isl_basic_set_factorizer(bset);
+ assert(f);
+ isl_basic_set_free(bset);
+ isl_factorizer_free(f);
+}
+