* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
-#include "isl_seq.h"
-#include "isl_set.h"
-#include "isl_map.h"
-#include "isl_map_private.h"
+#include <isl_map_private.h>
+#include <isl/seq.h>
+#include <isl/set.h>
+#include <isl/map.h>
#include "isl_tab.h"
#include <isl_point_private.h>
* Put the indices of the redundant constraints in index
* and return the number of redundant constraints.
*/
-static int n_non_redundant(struct isl_tab *tab, int offset, int **index)
+static int n_non_redundant(isl_ctx *ctx, struct isl_tab *tab,
+ int offset, int **index)
{
int i, n;
int n_test = tab->n_con - offset;
return -1;
if (!*index)
- *index = isl_alloc_array(tab->mat->ctx, int, n_test);
+ *index = isl_alloc_array(ctx, int, n_test);
if (!*index)
return -1;
* a negative value is treated as an error, but the calling
* function can interpret the results based on the state of dc.
*
- * Assumes that both bmap and map have known divs.
+ * Assumes that map has known divs.
*
* The difference is computed by a backtracking algorithm.
* Each level corresponds to a basic map in "map".
int level;
int init;
int empty;
+ isl_ctx *ctx;
struct isl_tab *tab = NULL;
struct isl_tab_undo **snap = NULL;
int *k = NULL;
if (!bmap || !map)
goto error;
+ ctx = map->ctx;
snap = isl_alloc_array(map->ctx, struct isl_tab_undo *, map->n);
k = isl_alloc_array(map->ctx, int, map->n);
n = isl_alloc_array(map->ctx, int, map->n);
continue;
}
modified = 1;
- n[level] = n_non_redundant(tab, offset, &index[level]);
+ n[level] = n_non_redundant(ctx, tab, offset,
+ &index[level]);
if (n[level] < 0)
goto error;
if (n[level] == 0) {
int r;
struct isl_is_empty_diff_collector edc;
- r = isl_basic_map_fast_is_empty(bmap);
+ r = isl_basic_map_plain_is_empty(bmap);
if (r)
return r;
/* Return 1 if "bmap" contains a single element.
*/
-int isl_basic_map_is_singleton(__isl_keep isl_basic_map *bmap)
+int isl_basic_map_plain_is_singleton(__isl_keep isl_basic_map *bmap)
{
if (!bmap)
return -1;
/* Return 1 if "map" contains a single element.
*/
-int isl_map_is_singleton(__isl_keep isl_map *map)
+int isl_map_plain_is_singleton(__isl_keep isl_map *map)
{
if (!map)
return -1;
if (map->n != 1)
return 0;
- return isl_basic_map_is_singleton(map->p[0]);
+ return isl_basic_map_plain_is_singleton(map->p[0]);
}
/* Given a singleton basic map, extract the single element
/* Return 1 is the singleton map "map1" is a subset of "map2",
* i.e., if the single element of "map1" is also an element of "map2".
+ * Assumes "map2" has known divs.
*/
static int map_is_singleton_subset(__isl_keep isl_map *map1,
__isl_keep isl_map *map2)
if (isl_map_is_empty(map2))
return 0;
- if (isl_map_fast_is_universe(map2))
+ if (isl_map_plain_is_universe(map2))
return 1;
- map1 = isl_map_compute_divs(isl_map_copy(map1));
map2 = isl_map_compute_divs(isl_map_copy(map2));
- if (isl_map_is_singleton(map1)) {
+ if (isl_map_plain_is_singleton(map1)) {
is_subset = map_is_singleton_subset(map1, map2);
- isl_map_free(map1);
isl_map_free(map2);
return is_subset;
}
is_subset = map_diff_is_empty(map1, map2);
- isl_map_free(map1);
isl_map_free(map2);
return is_subset;