* "M" describes the solution in terms of the dimensions of "dom".
* The number of columns of "M" is one more than the total number
* of dimensions of "dom".
+ *
+ * If "M" is NULL, then there is no solution on "dom".
*/
struct isl_partial_sol {
int level;
isl_basic_set_free(partial->next->dom);
partial->next->dom = bset;
M = partial->next->M;
- M = isl_mat_drop_cols(M, M->n_col - n, n);
- partial->next->M = M;
+ if (M) {
+ M = isl_mat_drop_cols(M, M->n_col - n, n);
+ partial->next->M = M;
+ if (!M)
+ goto error;
+ }
partial->next->level = sol->level;
- if (!bset || !M)
+ if (!bset)
goto error;
sol->partial = partial->next;
assert(isl_map_is_equal(map, map2));
isl_map_free(map);
isl_map_free(map2);
+
+ /* Check that empty pieces are properly combined. */
+ str = "[K, N] -> { [x, y] -> [a, b] : K+2<=N<=K+4 and x>=4 and "
+ "2N-6<=x<K+N and N-1<=a<=K+N-1 and N+b-6<=a<=2N-4 and "
+ "b<=2N-3K+a and 3b<=4N-K+1 and b>=N and a>=x+1 }";
+ map = isl_map_read_from_str(ctx, str);
+ map = isl_map_lexmin(map);
+ str = "[K, N] -> { [x, y] -> [1 + x, N] : x >= -6 + 2N and "
+ "x <= -5 + 2N and x >= -1 + 3K - N and x <= -2 + K + N and "
+ "x >= 4 }";
+ map2 = isl_map_read_from_str(ctx, str);
+ assert(isl_map_is_equal(map, map2));
+ isl_map_free(map);
+ isl_map_free(map2);
}
struct must_may {