Polly 23.0.0git
isl_union_map.c
Go to the documentation of this file.
1/*
2 * Copyright 2010-2011 INRIA Saclay
3 * Copyright 2013-2014 Ecole Normale Superieure
4 * Copyright 2014 INRIA Rocquencourt
5 * Copyright 2016-2017 Sven Verdoolaege
6 * Copyright 2022 Cerebras Systems
7 *
8 * Use of this software is governed by the MIT license
9 *
10 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
11 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
12 * 91893 Orsay, France
13 * and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
14 * B.P. 105 - 78153 Le Chesnay, France
15 * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA
16 */
17
18#include <isl_map_private.h>
20#include <isl/ctx.h>
21#include <isl/hash.h>
22#include <isl_aff_private.h>
23#include <isl/map.h>
24#include <isl/set.h>
25#include <isl_space_private.h>
26#include <isl/union_set.h>
27#include <isl_maybe_map.h>
28#include <isl_id_private.h>
29
30#include <bset_from_bmap.c>
31#include <set_to_map.c>
32#include <set_from_map.c>
33#include <uset_to_umap.c>
34#include <uset_from_umap.c>
36
37#undef TYPE
38#define TYPE isl_union_map
39static
41static
43
44/* Return the number of parameters of "umap", where "type"
45 * is required to be set to isl_dim_param.
46 */
48 enum isl_dim_type type)
49{
50 if (!umap)
51 return isl_size_error;
52
53 if (type != isl_dim_param)
55 "can only reference parameters", return isl_size_error);
56
57 return isl_space_dim(umap->dim, type);
58}
59
60/* Return the number of parameters of "uset", where "type"
61 * is required to be set to isl_dim_param.
62 */
68
69/* Return the id of the specified dimension.
70 */
72 enum isl_dim_type type, unsigned pos)
73{
74 if (!umap)
75 return NULL;
76
77 if (type != isl_dim_param)
79 "can only reference parameters", return NULL);
80
81 return isl_space_get_dim_id(umap->dim, type, pos);
82}
83
84/* Is this union set a parameter domain?
85 */
87{
88 isl_set *set;
90
91 if (!uset)
92 return isl_bool_error;
93 if (uset->table.n != 1)
94 return isl_bool_false;
95
99 return params;
100}
101
102/* Is this union map actually a parameter domain?
103 * Users should never call this function. Outside of isl,
104 * a union map can never be a parameter domain.
105 */
110
112 __isl_take isl_space *space, int size)
113{
114 isl_union_map *umap;
115
116 space = isl_space_params(space);
117 if (!space)
118 return NULL;
119
120 umap = isl_calloc_type(space->ctx, isl_union_map);
121 if (!umap) {
122 isl_space_free(space);
123 return NULL;
124 }
125
126 umap->ref = 1;
127 umap->dim = space;
128 if (isl_hash_table_init(space->ctx, &umap->table, size) < 0)
129 return isl_union_map_free(umap);
130
131 return umap;
132}
133
134/* Create an empty union map without specifying any parameters.
135 */
140
145
146/* This is an alternative name for the function above.
147 */
152
153/* Create an empty union set without specifying any parameters.
154 */
159
164
165/* This is an alternative name for the function above.
166 */
171
173{
174 return umap ? umap->dim->ctx : NULL;
175}
176
178{
179 return uset ? uset->dim->ctx : NULL;
180}
181
182/* Return the space of "umap".
183 */
185{
186 return umap ? umap->dim : NULL;
187}
188
189/* Return the space of "uset".
190 */
195
200
201/* Return the position of the parameter with the given name
202 * in "umap".
203 * Return -1 if no such dimension can be found.
204 */
206 enum isl_dim_type type, const char *name)
207{
208 if (!umap)
209 return -1;
210 return isl_space_find_dim_by_name(umap->dim, type, name);
211}
212
213/* Return the position of the parameter with id "id" in "umap".
214 * Return -1 if no such dimension can be found.
215 */
218{
219 isl_space *space;
220
221 space = isl_union_map_peek_space(umap);
222 return isl_space_find_dim_by_id(space, type, id);
223}
224
229
230static isl_stat free_umap_entry(void **entry, void *user)
231{
232 isl_map *map = *entry;
234 return isl_stat_ok;
235}
236
238{
239 isl_union_map **umap = (isl_union_map **)user;
240
241 *umap = isl_union_map_add_map(*umap, map);
242
243 return isl_stat_ok;
244}
245
247{
249
250 if (!umap)
251 return NULL;
252
254 if (isl_union_map_foreach_map(umap, &add_map, &dup) < 0)
255 goto error;
256 return dup;
257error:
259 return NULL;
260}
261
263{
264 if (!umap)
265 return NULL;
266
267 if (umap->ref == 1)
268 return umap;
269 umap->ref--;
270 return isl_union_map_dup(umap);
271}
272
277
278static isl_stat align_entry(void **entry, void *user)
279{
280 isl_map *map = *entry;
281 isl_reordering *exp;
282 struct isl_union_align *data = user;
283
286
287 data->res = isl_union_map_add_map(data->res,
289
290 return isl_stat_ok;
291}
292
293/* Align the parameters of umap along those of model.
294 * The result has the parameters of model first, in the same order
295 * as they appear in model, followed by any remaining parameters of
296 * umap that do not appear in model.
297 */
300{
301 struct isl_union_align data = { NULL, NULL };
302 isl_space *space;
303 isl_bool equal_params;
304
305 space = isl_union_map_peek_space(umap);
306 equal_params = isl_space_has_equal_params(space, model);
307 if (equal_params < 0)
308 goto error;
309 if (equal_params) {
310 isl_space_free(model);
311 return umap;
312 }
313
314 data.exp = isl_parameter_alignment_reordering(space, model);
315 if (!data.exp)
316 goto error;
317
319 umap->table.n);
320 if (isl_hash_table_foreach(isl_union_map_get_ctx(umap), &umap->table,
321 &align_entry, &data) < 0)
322 goto error;
323
325 isl_union_map_free(umap);
326 isl_space_free(model);
327 return data.res;
328error:
330 isl_union_map_free(umap);
332 isl_space_free(model);
333 return NULL;
334}
335
341
342/* This is a wrapper around isl_union_map_project_out for use
343 * by isl_union_map_drop_unused_params.
344 *
345 * In particular, this function is only called on parameters
346 * that are not involved in the description of "umap".
347 * Dropping those parameters is therefore equivalent
348 * to projecting them out.
349 */
352 enum isl_dim_type type, unsigned first, unsigned n)
353{
354 return isl_union_map_project_out(umap, type, first, n);
355}
356
357#undef TYPE
358#define TYPE isl_union_map
361
362/* Drop all parameters not referenced by "uset".
363 */
372
375{
378
379 umap1 = isl_union_map_cow(umap1);
380
381 if (!umap1 || !umap2)
382 goto error;
383
384 if (isl_union_map_foreach_map(umap2, &add_map, &umap1) < 0)
385 goto error;
386
387 isl_union_map_free(umap2);
388
389 return umap1;
390error:
391 isl_union_map_free(umap1);
392 isl_union_map_free(umap2);
393 return NULL;
394}
395
401
403{
404 if (!umap)
405 return NULL;
406
407 umap->ref++;
408 return umap;
409}
410
415
417{
418 if (!umap)
419 return NULL;
420
421 if (--umap->ref > 0)
422 return NULL;
423
424 isl_hash_table_foreach(umap->dim->ctx, &umap->table,
425 &free_umap_entry, NULL);
426 isl_hash_table_clear(&umap->table);
427 isl_space_free(umap->dim);
428 free(umap);
429 return NULL;
430}
431
436
437/* Do "umap" and "space" have the same parameters?
438 */
440 __isl_keep isl_space *space)
441{
442 isl_space *umap_space;
443
444 umap_space = isl_union_map_peek_space(umap);
445 return isl_space_has_equal_params(umap_space, space);
446}
447
448/* Do "uset" and "space" have the same parameters?
449 */
455
456/* Is the space of the map at "entry" equal to "space", ignoring parameters?
457 */
458static isl_bool has_space_tuples(const void *entry, const void *val)
459{
460 isl_map *map = (isl_map *)entry;
461 isl_space *space = (isl_space *) val;
462
463 return isl_map_has_space_tuples(map, space);
464}
465
466/* Find the entry in "umap" with space "space" (ignoring parameters),
467 * returning isl_hash_table_entry_none if no such entry appears in "umap" and
468 * NULL on error.
469 * If "reserve" is set, then an entry is created if it does
470 * not exist already. Since this modifies the hash table in-place,
471 * this means "umap" must have a single reference when "reserve" is set.
472 */
475 int reserve)
476{
477 uint32_t hash;
478
479 if (!umap || !space)
480 return NULL;
481 if (reserve && isl_union_map_check_single_reference(umap) < 0)
482 return NULL;
483
485 return isl_hash_table_find(isl_union_map_get_ctx(umap), &umap->table,
486 hash, &has_space_tuples, space, reserve);
487}
488
489/* Find the entry in "uset" with space "space" (ignoring parameters),
490 * returning isl_hash_table_entry_none if no such entry appears in "uset" and
491 * NULL on error.
492 * If "reserve" is set, then an entry is created if it does
493 * not exist already. In this case, a NULL return indicates an error.
494 */
497 int reserve)
498{
499 return isl_union_map_find_entry(uset_to_umap(uset), space, reserve);
500}
501
504{
505 struct isl_hash_table_entry *entry;
506 isl_bool aligned;
507 isl_space *space;
508
509 if (!map || !umap)
510 goto error;
511
514 return umap;
515 }
516
517 aligned = isl_map_space_has_equal_params(map, umap->dim);
518 if (aligned < 0)
519 goto error;
520 if (!aligned) {
523 }
524
525 umap = isl_union_map_cow(umap);
526
527 space = isl_map_peek_space(map);
528 entry = isl_union_map_find_entry(umap, space, 1);
529 if (!entry)
530 goto error;
531
532 if (!entry->data)
533 entry->data = map;
534 else {
535 entry->data = isl_map_union(entry->data, isl_map_copy(map));
536 if (!entry->data)
537 goto error;
539 }
540
541 return umap;
542error:
544 isl_union_map_free(umap);
545 return NULL;
546}
547
553
555{
556 isl_space *space;
557 isl_union_map *umap;
558
559 if (!map)
560 return NULL;
561
562 space = isl_map_get_space(map);
563 space = isl_space_params(space);
564 umap = isl_union_map_empty(space);
565 umap = isl_union_map_add_map(umap, map);
566
567 return umap;
568}
569
570/* This function performs the same operation as isl_union_map_from_map,
571 * but is considered as a function on an isl_map when exported.
572 */
577
582
583/* This function performs the same operation as isl_union_set_from_set,
584 * but is considered as a function on an isl_set when exported.
585 */
590
596
602
608
609static isl_stat call_on_copy(void **entry, void *user)
610{
611 isl_map *map = *entry;
612 struct isl_union_map_foreach_data *data;
613 data = (struct isl_union_map_foreach_data *)user;
614
615 return data->fn(isl_map_copy(map), data->user);
616}
617
619{
620 return umap ? umap->table.n : isl_size_error;
621}
622
624{
625 return uset ? uset->table.n : isl_size_error;
626}
627
629 isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user)
630{
631 struct isl_union_map_foreach_data data = { fn, user };
632
633 if (!umap)
634 return isl_stat_error;
635
636 return isl_hash_table_foreach(umap->dim->ctx, &umap->table,
637 &call_on_copy, &data);
638}
639
640/* Internal data structure for isl_union_map_every_map.
641 *
642 * "test" is the user-specified callback function.
643 * "user" is the user-specified callback function argument.
644 *
645 * "failed" is initialized to 0 and set to 1 if "test" fails
646 * on any map.
647 */
650 void *user;
651 int failed;
652};
653
654/* Call data->test on "map".
655 * If this fails, then set data->failed and abort.
656 */
657static isl_stat call_every(void **entry, void *user)
658{
659 isl_map *map = *entry;
660 struct isl_union_map_every_data *data = user;
661 isl_bool r;
662
663 r = data->test(map, data->user);
664 if (r < 0)
665 return isl_stat_error;
666 if (r)
667 return isl_stat_ok;
668 data->failed = 1;
669 return isl_stat_error;
670}
671
672/* Does "test" succeed on every map in "umap"?
673 */
675 isl_bool (*test)(__isl_keep isl_map *map, void *user), void *user)
676{
677 struct isl_union_map_every_data data = { test, user, 0 };
678 isl_stat r;
679
680 if (!umap)
681 return isl_bool_error;
682
683 r = isl_hash_table_foreach(isl_union_map_get_ctx(umap), &umap->table,
684 &call_every, &data);
685 if (r >= 0)
686 return isl_bool_true;
687 if (data.failed)
688 return isl_bool_false;
689 return isl_bool_error;
690}
691
692/* Add "map" to "list".
693 */
695{
696 isl_map_list **list = user;
697
698 *list = isl_map_list_add(*list, map);
699
700 if (!*list)
701 return isl_stat_error;
702 return isl_stat_ok;
703}
704
705/* Return the maps in "umap" as a list.
706 *
707 * First construct a list of the appropriate size and then add all the
708 * elements.
709 */
712{
713 isl_size n_maps;
714 isl_ctx *ctx;
715 isl_map_list *list;
716
717 n_maps = isl_union_map_n_map(umap);
718 if (n_maps < 0)
719 return NULL;
720 ctx = isl_union_map_get_ctx(umap);
721 list = isl_map_list_alloc(ctx, n_maps);
722
723 if (isl_union_map_foreach_map(umap, &add_list_map, &list) < 0)
724 list = isl_map_list_free(list);
725
726 return list;
727}
728
729/* Return the sets in "uset" as a list.
730 */
737
738/* Can "umap" be converted to an isl_map?
739 * That is, does it contain elements in exactly one space?
740 */
742{
743 isl_size n;
744
745 n = isl_union_map_n_map(umap);
746 if (n < 0)
747 return isl_bool_error;
748 return isl_bool_ok(n == 1);
749}
750
751/* Can "uset" be converted to an isl_set?
752 * That is, does it contain elements in exactly one space?
753 */
758
759static isl_stat copy_map(void **entry, void *user)
760{
761 isl_map *map = *entry;
762 isl_map **map_p = user;
763
764 *map_p = isl_map_copy(map);
765
766 return isl_stat_error;
767}
768
770{
771 isl_bool is_map;
772 isl_ctx *ctx;
773 isl_map *map = NULL;
774
775 is_map = isl_union_map_isa_map(umap);
776 if (is_map < 0)
777 goto error;
778 ctx = isl_union_map_get_ctx(umap);
779 if (!is_map)
781 "union map needs to contain elements in exactly "
782 "one space", goto error);
783
784 isl_hash_table_foreach(ctx, &umap->table, &copy_map, &map);
785
786 isl_union_map_free(umap);
787
788 return map;
789error:
790 isl_union_map_free(umap);
791 return NULL;
792}
793
794/* This function performs the same operation as isl_map_from_union_map,
795 * but is considered as a function on an isl_union_map when exported.
796 */
801
806
807/* This function performs the same operation as isl_set_from_union_set,
808 * but is considered as a function on an isl_union_set when exported.
809 */
814
815/* Extract the map in "umap" that lives in the given space (ignoring
816 * parameters).
817 */
819 __isl_take isl_space *space)
820{
821 struct isl_hash_table_entry *entry;
822
823 entry = isl_union_map_find_entry(umap, space, 0);
824 if (!entry)
825 goto error;
826 if (entry == isl_hash_table_entry_none)
827 return isl_map_empty(space);
828 isl_space_free(space);
829 return isl_map_copy(entry->data);
830error:
831 isl_space_free(space);
832 return NULL;
833}
834
840
841/* Check if umap contains a map in the given space (ignoring parameters).
842 */
844 __isl_keep isl_space *space)
845{
846 struct isl_hash_table_entry *entry;
847
850 entry = isl_union_map_find_entry(umap, space, 0);
851 isl_space_free(space);
852 if (!entry)
853 return isl_bool_error;
854 return isl_bool_ok(entry != isl_hash_table_entry_none);
855}
856
862
869
870/* Internal data structure for isl_union_set_every_set.
871 *
872 * "test" is the user-specified callback function.
873 * "user" is the user-specified callback function argument.
874 */
879
880/* Call data->test on "map", which is part of an isl_union_set and
881 * therefore known to be an isl_set.
882 */
884{
885 struct isl_test_set_from_map_data *data = user;
886
887 return data->test(set_from_map(map), data->user);
888}
889
890/* Does "test" succeed on every set in "uset"?
891 */
900
905
907{
909 isl_stat r;
910
911 r = isl_set_foreach_point(set, data->fn, data->user);
913
914 return r;
915}
916
923
924/* Data structure that specifies how gen_bin_op should
925 * construct results from the inputs.
926 *
927 * If "subtract" is set, then a map in the first input is copied to the result
928 * if there is no corresponding map in the second input.
929 * Otherwise, a map in the first input with no corresponding map
930 * in the second input is ignored.
931 * If "filter" is not NULL, then it specifies which maps in the first
932 * input may have a matching map in the second input.
933 * In particular, it makes sure that "match_space" can be called
934 * on the space of the map.
935 * "match_space" specifies how to transform the space of a map
936 * in the first input to the space of the corresponding map
937 * in the second input.
938 * "fn_map" specifies how the matching maps, one from each input,
939 * should be combined to form a map in the result.
940 */
948
949/* Internal data structure for gen_bin_op.
950 * "control" specifies how the maps in the result should be constructed.
951 * "umap2" is a pointer to the second argument.
952 * "res" collects the results.
953 */
959
960/* Add a copy of "map" to "res" and return the result.
961 */
967
968/* Combine "map1" and "map2", add the result to "res" and return the result.
969 * Check whether the result is empty before adding it to "res".
970 */
973 struct isl_union_map_gen_bin_data *data)
974{
975 isl_bool empty;
976 isl_map *map;
977
979 empty = isl_map_is_empty(map);
980 if (empty < 0 || empty) {
982 if (empty < 0)
983 return isl_union_map_free(res);
984 return res;
985 }
987}
988
989/* Dummy match_space function that simply returns the input space.
990 */
992{
993 return space;
994}
995
996/* Look for the map in data->umap2 that corresponds to "map", if any.
997 * Return (isl_bool_true, matching map) if there is one,
998 * (isl_bool_false, NULL) if there is no matching map and
999 * (isl_bool_error, NULL) on error.
1000 *
1001 * If not NULL, then data->control->filter specifies whether "map"
1002 * can have any matching map. If so,
1003 * data->control->match_space specifies which map in data->umap2
1004 * corresponds to "map".
1005 */
1006static __isl_keep isl_maybe_isl_map bin_try_get_match(
1008{
1009 struct isl_hash_table_entry *entry2;
1010 isl_space *space;
1011 isl_maybe_isl_map res = { isl_bool_error, NULL };
1012
1013 if (data->control->filter) {
1014 res.valid = data->control->filter(map);
1015 if (res.valid < 0 || !res.valid)
1016 return res;
1017 res.valid = isl_bool_error;
1018 }
1019
1020 space = isl_map_get_space(map);
1021 if (data->control->match_space != &identity)
1022 space = data->control->match_space(space);
1023 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
1024 isl_space_free(space);
1025 if (entry2)
1026 res.valid = isl_bool_ok(entry2 != isl_hash_table_entry_none);
1027 if (res.valid >= 0 && res.valid)
1028 res.value = entry2->data;
1029
1030 return res;
1031}
1032
1033/* isl_hash_table_foreach callback for gen_bin_op.
1034 * Look for the map in data->umap2 that corresponds
1035 * to the map that "entry" points to, apply the binary operation and
1036 * add the result to data->res.
1037 *
1038 * If no corresponding map can be found, then the effect depends
1039 * on data->control->subtract. If it is set, then the current map
1040 * is added directly to the result. Otherwise, it is ignored.
1041 */
1042static isl_stat gen_bin_entry(void **entry, void *user)
1043{
1044 struct isl_union_map_gen_bin_data *data = user;
1045 isl_map *map = *entry;
1046 isl_maybe_isl_map m;
1047
1048 m = bin_try_get_match(data, map);
1049 if (m.valid < 0)
1050 return isl_stat_error;
1051 if (!m.valid && !data->control->subtract)
1052 return isl_stat_ok;
1053
1054 if (!m.valid)
1055 data->res = bin_add_map(data->res, map);
1056 else
1057 data->res = bin_add_pair(data->res, map, m.value, data);
1058 if (!data->res)
1059 return isl_stat_error;
1060
1061 return isl_stat_ok;
1062}
1063
1064/* Apply a binary operation to "umap1" and "umap2" based on "control".
1065 * Run over all maps in "umap1" and look for the corresponding map in "umap2"
1066 * in gen_bin_entry.
1067 */
1070{
1071 struct isl_union_map_gen_bin_data data = { control, NULL, NULL };
1072
1075
1076 if (!umap1 || !umap2)
1077 goto error;
1078
1079 data.umap2 = umap2;
1080 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim),
1081 umap1->table.n);
1082 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
1083 &gen_bin_entry, &data) < 0)
1084 goto error;
1085
1086 isl_union_map_free(umap1);
1088 return data.res;
1089error:
1090 isl_union_map_free(umap1);
1092 isl_union_map_free(data.res);
1093 return NULL;
1094}
1095
1098{
1099 struct isl_bin_op_control control = {
1100 .subtract = 1,
1101 .match_space = &identity,
1102 .fn_map = &isl_map_subtract,
1103 };
1104
1105 return gen_bin_op(umap1, umap2, &control);
1106}
1107
1113
1118
1119static isl_stat intersect_params_entry(void **entry, void *user)
1120{
1121 struct isl_union_map_gen_bin_set_data *data = user;
1122 isl_map *map = *entry;
1123 int empty;
1124
1125 map = isl_map_copy(map);
1127
1128 empty = isl_map_is_empty(map);
1129 if (empty < 0) {
1131 return isl_stat_error;
1132 }
1133
1134 data->res = isl_union_map_add_map(data->res, map);
1135
1136 return isl_stat_ok;
1137}
1138
1140 __isl_take isl_set *set, isl_stat (*fn)(void **, void *))
1141{
1142 struct isl_union_map_gen_bin_set_data data = { NULL, NULL };
1143
1146
1147 if (!umap || !set)
1148 goto error;
1149
1150 data.set = set;
1151 data.res = isl_union_map_alloc(isl_space_copy(umap->dim),
1152 umap->table.n);
1153 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
1154 fn, &data) < 0)
1155 goto error;
1156
1157 isl_union_map_free(umap);
1159 return data.res;
1160error:
1161 isl_union_map_free(umap);
1163 isl_union_map_free(data.res);
1164 return NULL;
1165}
1166
1167/* Intersect "umap" with the parameter domain "set".
1168 *
1169 * If "set" does not have any constraints, then we can return immediately.
1170 */
1173{
1174 int is_universe;
1175
1176 is_universe = isl_set_plain_is_universe(set);
1177 if (is_universe < 0)
1178 goto error;
1179 if (is_universe) {
1181 return umap;
1182 }
1183
1185error:
1186 isl_union_map_free(umap);
1188 return NULL;
1189}
1190
1196
1203
1209
1215
1216static isl_stat match_bin_entry(void **entry, void *user)
1217{
1218 struct isl_union_map_match_bin_data *data = user;
1219 struct isl_hash_table_entry *entry2;
1220 isl_space *space;
1221 isl_map *map = *entry;
1222 int empty;
1223
1224 space = isl_map_peek_space(map);
1225 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
1226 if (!entry2)
1227 return isl_stat_error;
1228 if (entry2 == isl_hash_table_entry_none)
1229 return isl_stat_ok;
1230
1231 map = isl_map_copy(map);
1232 map = data->fn(map, isl_map_copy(entry2->data));
1233
1234 empty = isl_map_is_empty(map);
1235 if (empty < 0) {
1237 return isl_stat_error;
1238 }
1239 if (empty) {
1241 return isl_stat_ok;
1242 }
1243
1244 data->res = isl_union_map_add_map(data->res, map);
1245
1246 return isl_stat_ok;
1247}
1248
1252{
1253 struct isl_union_map_match_bin_data data = { NULL, NULL, fn };
1254
1257
1258 if (!umap1 || !umap2)
1259 goto error;
1260
1261 data.umap2 = umap2;
1262 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim),
1263 umap1->table.n);
1264 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
1265 &match_bin_entry, &data) < 0)
1266 goto error;
1267
1268 isl_union_map_free(umap1);
1270 return data.res;
1271error:
1272 isl_union_map_free(umap1);
1274 isl_union_map_free(data.res);
1275 return NULL;
1276}
1277
1283
1284/* Compute the intersection of the two union_sets.
1285 * As a special case, if exactly one of the two union_sets
1286 * is a parameter domain, then intersect the parameter domain
1287 * of the other one with this set.
1288 */
1291{
1292 int p1, p2;
1293
1294 p1 = isl_union_set_is_params(uset1);
1295 p2 = isl_union_set_is_params(uset2);
1296 if (p1 < 0 || p2 < 0)
1297 goto error;
1298 if (!p1 && p2)
1299 return union_map_intersect_params(uset1, uset2);
1300 if (p1 && !p2)
1301 return union_map_intersect_params(uset2, uset1);
1302 return isl_union_map_intersect(uset1, uset2);
1303error:
1304 isl_union_set_free(uset1);
1305 isl_union_set_free(uset2);
1306 return NULL;
1307}
1308
1309static isl_stat gist_params_entry(void **entry, void *user)
1310{
1311 struct isl_union_map_gen_bin_set_data *data = user;
1312 isl_map *map = *entry;
1313 int empty;
1314
1315 map = isl_map_copy(map);
1317
1318 empty = isl_map_is_empty(map);
1319 if (empty < 0) {
1321 return isl_stat_error;
1322 }
1323
1324 data->res = isl_union_map_add_map(data->res, map);
1325
1326 return isl_stat_ok;
1327}
1328
1334
1340
1346
1354
1355/* For each map in "umap", remove the constraints in the corresponding map
1356 * of "context".
1357 * Each map in "context" is assumed to consist of a single disjunct and
1358 * to have explicit representations for all local variables.
1359 */
1365
1366/* For each set in "uset", remove the constraints in the corresponding set
1367 * of "context".
1368 * Each set in "context" is assumed to consist of a single disjunct and
1369 * to have explicit representations for all local variables.
1370 */
1376
1382
1388
1394
1400
1406
1412
1418
1424
1425/* Intersect the domain of "umap" with "uset".
1426 */
1429{
1430 struct isl_bin_op_control control = {
1431 .match_space = &isl_space_domain,
1432 .fn_map = &isl_map_intersect_domain,
1433 };
1434
1435 return gen_bin_op(umap, uset, &control);
1436}
1437
1438/* Intersect the domain of "umap" with "uset".
1439 * If "uset" is a parameters domain, then intersect the parameter
1440 * domain of "umap" with this set.
1441 */
1450
1451/* This is an alternative name for the function above.
1452 */
1458
1459/* Remove the elements of "uset" from the domain of "umap".
1460 */
1463{
1464 struct isl_bin_op_control control = {
1465 .subtract = 1,
1466 .match_space = &isl_space_domain,
1467 .fn_map = &isl_map_subtract_domain,
1468 };
1469
1470 return gen_bin_op(umap, dom, &control);
1471}
1472
1473/* Remove the elements of "uset" from the range of "umap".
1474 */
1477{
1478 struct isl_bin_op_control control = {
1479 .subtract = 1,
1480 .match_space = &isl_space_range,
1481 .fn_map = &isl_map_subtract_range,
1482 };
1483
1484 return gen_bin_op(umap, dom, &control);
1485}
1486
1487/* Compute the gist of "umap" with respect to the domain "uset".
1488 */
1491{
1492 struct isl_bin_op_control control = {
1493 .match_space = &isl_space_domain,
1494 .fn_map = &isl_map_gist_domain,
1495 };
1496
1497 return gen_bin_op(umap, uset, &control);
1498}
1499
1500/* Compute the gist of "umap" with respect to the domain "uset".
1501 * If "uset" is a parameters domain, then compute the gist
1502 * with respect to this parameter domain.
1503 */
1506{
1507 if (isl_union_set_is_params(uset))
1508 return union_map_gist_params(umap, uset);
1509 else
1510 return union_map_gist_domain(umap, uset);
1511}
1512
1513/* Compute the gist of "umap" with respect to the range "uset".
1514 */
1517{
1518 struct isl_bin_op_control control = {
1519 .match_space = &isl_space_range,
1520 .fn_map = &isl_map_gist_range,
1521 };
1522
1523 return gen_bin_op(umap, uset, &control);
1524}
1525
1528{
1529 struct isl_bin_op_control control = {
1530 .match_space = &isl_space_range,
1531 .fn_map = &isl_map_intersect_range,
1532 };
1533
1534 return gen_bin_op(umap, uset, &control);
1535}
1536
1537/* This is an alternative name for the function above.
1538 */
1544
1545/* Intersect each map in "umap" in a space [A -> B] -> C
1546 * with the corresponding map in "factor" in the space A -> C and
1547 * collect the results.
1548 */
1551{
1552 struct isl_bin_op_control control = {
1553 .filter = &isl_map_domain_is_wrapping,
1554 .match_space = &isl_space_domain_factor_domain,
1556 };
1557
1558 return gen_bin_op(umap, factor, &control);
1559}
1560
1561/* Intersect each map in "umap" in a space [A -> B] -> C
1562 * with the corresponding map in "factor" in the space B -> C and
1563 * collect the results.
1564 */
1567{
1568 struct isl_bin_op_control control = {
1569 .filter = &isl_map_domain_is_wrapping,
1570 .match_space = &isl_space_domain_factor_range,
1572 };
1573
1574 return gen_bin_op(umap, factor, &control);
1575}
1576
1577/* Intersect each map in "umap" in a space A -> [B -> C]
1578 * with the corresponding map in "factor" in the space A -> B and
1579 * collect the results.
1580 */
1583{
1584 struct isl_bin_op_control control = {
1585 .filter = &isl_map_range_is_wrapping,
1586 .match_space = &isl_space_range_factor_domain,
1588 };
1589
1590 return gen_bin_op(umap, factor, &control);
1591}
1592
1593/* Intersect each map in "umap" in a space A -> [B -> C]
1594 * with the corresponding map in "factor" in the space A -> C and
1595 * collect the results.
1596 */
1599{
1600 struct isl_bin_op_control control = {
1601 .filter = &isl_map_range_is_wrapping,
1602 .match_space = &isl_space_range_factor_range,
1604 };
1605
1606 return gen_bin_op(umap, factor, &control);
1607}
1608
1615
1616static isl_stat apply_range_entry(void **entry, void *user)
1617{
1618 struct isl_union_map_bin_data *data = user;
1619 isl_map *map2 = *entry;
1620 isl_bool empty, match;
1621
1623 map2, isl_dim_in);
1624 if (match < 0)
1625 return isl_stat_error;
1626 if (!match)
1627 return isl_stat_ok;
1628
1630
1631 empty = isl_map_is_empty(map2);
1632 if (empty < 0) {
1634 return isl_stat_error;
1635 }
1636 if (empty) {
1638 return isl_stat_ok;
1639 }
1640
1641 data->res = isl_union_map_add_map(data->res, map2);
1642
1643 return isl_stat_ok;
1644}
1645
1646static isl_stat bin_entry(void **entry, void *user)
1647{
1648 struct isl_union_map_bin_data *data = user;
1649 isl_map *map = *entry;
1650
1651 data->map = map;
1652 if (isl_hash_table_foreach(data->umap2->dim->ctx, &data->umap2->table,
1653 data->fn, data) < 0)
1654 return isl_stat_error;
1655
1656 return isl_stat_ok;
1657}
1658
1661 isl_stat (*fn)(void **entry, void *user))
1662{
1663 struct isl_union_map_bin_data data = { NULL, NULL, NULL, fn };
1664
1667
1668 if (!umap1 || !umap2)
1669 goto error;
1670
1671 data.umap2 = umap2;
1672 data.res = isl_union_map_alloc(isl_space_copy(umap1->dim),
1673 umap1->table.n);
1674 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
1675 &bin_entry, &data) < 0)
1676 goto error;
1677
1678 isl_union_map_free(umap1);
1680 return data.res;
1681error:
1682 isl_union_map_free(umap1);
1684 isl_union_map_free(data.res);
1685 return NULL;
1686}
1687
1688/* Intersect each map in "umap" in a space [A -> B] -> C
1689 * with the corresponding set in "domain" in the space A and
1690 * collect the results.
1691 */
1695{
1696 struct isl_bin_op_control control = {
1697 .filter = &isl_map_domain_is_wrapping,
1698 .match_space = &isl_space_domain_wrapped_domain,
1700 };
1701
1702 return gen_bin_op(umap, domain, &control);
1703}
1704
1705/* Intersect each map in "umap" in a space A -> [B -> C]
1706 * with the corresponding set in "domain" in the space B and
1707 * collect the results.
1708 */
1712{
1713 struct isl_bin_op_control control = {
1714 .filter = &isl_map_range_is_wrapping,
1715 .match_space = &isl_space_range_wrapped_domain,
1717 };
1718
1719 return gen_bin_op(umap, domain, &control);
1720}
1721
1727
1730{
1731 umap1 = isl_union_map_reverse(umap1);
1732 umap1 = isl_union_map_apply_range(umap1, umap2);
1733 return isl_union_map_reverse(umap1);
1734}
1735
1741
1742static isl_stat map_lex_lt_entry(void **entry, void *user)
1743{
1744 struct isl_union_map_bin_data *data = user;
1745 isl_map *map2 = *entry;
1747
1749 map2, isl_dim_out);
1750 if (match < 0)
1751 return isl_stat_error;
1752 if (!match)
1753 return isl_stat_ok;
1754
1756
1757 data->res = isl_union_map_add_map(data->res, map2);
1758
1759 return isl_stat_ok;
1760}
1761
1767
1768static isl_stat map_lex_le_entry(void **entry, void *user)
1769{
1770 struct isl_union_map_bin_data *data = user;
1771 isl_map *map2 = *entry;
1773
1775 map2, isl_dim_out);
1776 if (match < 0)
1777 return isl_stat_error;
1778 if (!match)
1779 return isl_stat_ok;
1780
1782
1783 data->res = isl_union_map_add_map(data->res, map2);
1784
1785 return isl_stat_ok;
1786}
1787
1793
1794static isl_stat product_entry(void **entry, void *user)
1795{
1796 struct isl_union_map_bin_data *data = user;
1797 isl_map *map2 = *entry;
1798
1800
1801 data->res = isl_union_map_add_map(data->res, map2);
1802
1803 return isl_stat_ok;
1804}
1805
1811
1812static isl_stat set_product_entry(void **entry, void *user)
1813{
1814 struct isl_union_map_bin_data *data = user;
1815 isl_set *set2 = *entry;
1816
1818
1819 data->res = isl_union_set_add_set(data->res, set2);
1820
1821 return isl_stat_ok;
1822}
1823
1829
1830static isl_stat domain_product_entry(void **entry, void *user)
1831{
1832 struct isl_union_map_bin_data *data = user;
1833 isl_map *map2 = *entry;
1835
1837 map2, isl_dim_out);
1838 if (match < 0)
1839 return isl_stat_error;
1840 if (!match)
1841 return isl_stat_ok;
1842
1845
1846 data->res = isl_union_map_add_map(data->res, map2);
1847
1848 return isl_stat_ok;
1849}
1850
1851/* Given two maps A -> B and C -> D, construct a map [A -> C] -> (B * D)
1852 */
1858
1859static isl_stat range_product_entry(void **entry, void *user)
1860{
1861 struct isl_union_map_bin_data *data = user;
1862 isl_map *map2 = *entry;
1864
1866 if (match < 0)
1867 return isl_stat_error;
1868 if (!match)
1869 return isl_stat_ok;
1870
1873
1874 data->res = isl_union_map_add_map(data->res, map2);
1875
1876 return isl_stat_ok;
1877}
1878
1884
1885/* If data->map A -> B and "map2" C -> D have the same range space,
1886 * then add (A, C) -> (B * D) to data->res.
1887 */
1888static isl_stat flat_domain_product_entry(void **entry, void *user)
1889{
1890 struct isl_union_map_bin_data *data = user;
1891 isl_map *map2 = *entry;
1893
1895 map2, isl_dim_out);
1896 if (match < 0)
1897 return isl_stat_error;
1898 if (!match)
1899 return isl_stat_ok;
1900
1903
1904 data->res = isl_union_map_add_map(data->res, map2);
1905
1906 return isl_stat_ok;
1907}
1908
1909/* Given two maps A -> B and C -> D, construct a map (A, C) -> (B * D).
1910 */
1916
1917static isl_stat flat_range_product_entry(void **entry, void *user)
1918{
1919 struct isl_union_map_bin_data *data = user;
1920 isl_map *map2 = *entry;
1922
1924 if (match < 0)
1925 return isl_stat_error;
1926 if (!match)
1927 return isl_stat_ok;
1928
1931
1932 data->res = isl_union_map_add_map(data->res, map2);
1933
1934 return isl_stat_ok;
1935}
1936
1942
1943/* Data structure that specifies how un_op should modify
1944 * the maps in the union map.
1945 *
1946 * If "inplace" is set, then the maps in the input union map
1947 * are modified in place. This means that "fn_map" should not
1948 * change the meaning of the map or that the union map only
1949 * has a single reference.
1950 * If "total" is set, then all maps need to be modified and
1951 * the results need to live in the same space.
1952 * Otherwise, a new union map is constructed to store the results.
1953 * If "filter" is not NULL, then only the input maps that satisfy "filter"
1954 * are taken into account. "filter_user" is passed as the second argument
1955 * to "filter". No filter can be set if "inplace" or
1956 * "total" is set.
1957 * At most one of "fn_map" or "fn_map2" can be set, specifying
1958 * how the maps (selected by "filter") should be transformed.
1959 * If "fn_map2" is set, then "fn_map2_user" is passed as the second argument.
1960 */
1970
1971/* Data structure for wrapping the data for un_op_filter_drop_user.
1972 * "filter" is the function that is being wrapped.
1973 */
1977
1978/* Wrapper for isl_un_op_control filters that do not require
1979 * a second argument.
1980 * Simply call data->filter without the second argument.
1981 */
1983{
1984 struct isl_un_op_drop_user_data *data = user;
1985 return data->filter(map);
1986}
1987
1988/* Internal data structure for "un_op".
1989 * "control" specifies how the maps in the union map should be modified.
1990 * "res" collects the results.
1991 */
1996
1997/* isl_hash_table_foreach callback for un_op.
1998 * Handle the map that "entry" points to.
1999 *
2000 * If control->filter is set, then check if this map satisfies the filter.
2001 * If so (or if control->filter is not set), modify the map
2002 * by calling control->fn_map or control->fn_map2 (if set) and
2003 * either add the result to data->res or
2004 * replace the original entry by the result (if control->inplace is set).
2005 */
2006static isl_stat un_entry(void **entry, void *user)
2007{
2008 struct isl_union_map_un_data *data = user;
2009 struct isl_un_op_control *control = data->control;
2010 isl_map *map = *entry;
2011
2012 if (control->filter) {
2013 isl_bool ok;
2014
2015 ok = control->filter(map, control->filter_user);
2016 if (ok < 0)
2017 return isl_stat_error;
2018 if (!ok)
2019 return isl_stat_ok;
2020 }
2021
2022 map = isl_map_copy(map);
2023 if (control->fn_map2 != NULL)
2024 map = control->fn_map2(map, control->fn_map2_user);
2025 else if (control->fn_map != NULL)
2026 map = control->fn_map(map);
2027 if (!map)
2028 return isl_stat_error;
2029 if (control->inplace) {
2030 isl_map_free(*entry);
2031 *entry = map;
2032 } else {
2033 data->res = isl_union_map_add_map(data->res, map);
2034 if (!data->res)
2035 return isl_stat_error;
2036 }
2037
2038 return isl_stat_ok;
2039}
2040
2041/* Modify the maps in "umap" based on "control".
2042 * If control->inplace is set, then modify the maps in "umap" in-place.
2043 * Otherwise, create a new union map to hold the results.
2044 * If control->total is set, then perform an inplace computation
2045 * if "umap" is only referenced once. Otherwise, create a new union map
2046 * to store the results.
2047 */
2049 struct isl_un_op_control *control)
2050{
2051 struct isl_union_map_un_data data = { control };
2052
2053 if (!umap)
2054 return NULL;
2055 if (!!control->fn_map && !!control->fn_map2)
2057 "at most one mapping function can be specified",
2058 return isl_union_map_free(umap));
2059 if ((control->inplace || control->total) && control->filter)
2061 "inplace/total modification cannot be filtered",
2062 return isl_union_map_free(umap));
2063
2064 if (control->total && umap->ref == 1)
2065 control->inplace = 1;
2066 if (control->inplace) {
2067 data.res = umap;
2068 } else {
2069 isl_space *space;
2070
2071 space = isl_union_map_get_space(umap);
2072 data.res = isl_union_map_alloc(space, umap->table.n);
2073 }
2075 &umap->table, &un_entry, &data) < 0)
2076 data.res = isl_union_map_free(data.res);
2077
2078 if (control->inplace)
2079 return data.res;
2080 isl_union_map_free(umap);
2081 return data.res;
2082}
2083
2086{
2087 struct isl_un_op_control control = {
2088 .fn_map = &isl_map_from_range,
2089 };
2090 return un_op(uset, &control);
2091}
2092
2098
2105
2106/* Modify the maps in "umap" by applying "fn" on them.
2107 * "fn" should apply to all maps in "umap" and should not modify the space.
2108 */
2111{
2112 struct isl_un_op_control control = {
2113 .total = 1,
2114 .fn_map = fn,
2115 };
2116
2117 return un_op(umap, &control);
2118}
2119
2120/* Compute the affine hull of "map" and return the result as an isl_map.
2121 */
2126
2132
2138
2139/* Wrapper around isl_set_combined_lineality_space
2140 * that returns the combined lineality space in the form of an isl_set
2141 * instead of an isl_basic_set.
2142 */
2147
2148/* For each set in "uset", compute the (linear) hull
2149 * of the lineality spaces of its basic sets and
2150 * collect and return the results.
2151 */
2154{
2155 struct isl_un_op_control control = {
2156 .fn_map = &combined_lineality_space,
2157 };
2158 return un_op(uset, &control);
2159}
2160
2161/* Compute the polyhedral hull of "map" and return the result as an isl_map.
2162 */
2167
2173
2179
2180/* Compute a superset of the convex hull of "map" that is described
2181 * by only translates of the constraints in the constituents of "map" and
2182 * return the result as an isl_map.
2183 */
2188
2194
2200
2201/* Compute a superset of the convex hull of "map" that is described
2202 * by only the constraints in the constituents of "map" and
2203 * return the result as an isl_map.
2204 * In particular, the result is composed of constraints that appear
2205 * in each of the basic maps of "map".
2206 */
2212
2213/* For each map in "umap", compute a superset of the convex hull
2214 * that is described by only the constraints in the constituents of that map and
2215 * collect the results.
2216 * In particular, each result is composed of constraints that appear
2217 * in each of the basic maps of the corresponding map.
2218 */
2224
2225/* For each set in "uset", compute a superset of the convex hull
2226 * that is described by only the constraints in the constituents of that set and
2227 * collect the results.
2228 * In particular, each result is composed of constraints that appear
2229 * in each of the basic sets of the corresponding set.
2230 */
2239
2242{
2243 struct isl_un_op_control control = {
2244 .inplace = 1,
2245 .fn_map = fn,
2246 };
2247
2248 return un_op(umap, &control);
2249}
2250
2251/* Remove redundant constraints in each of the basic maps of "umap".
2252 * Since removing redundant constraints does not change the meaning
2253 * or the space, the operation can be performed in-place.
2254 */
2260
2261/* Remove redundant constraints in each of the basic sets of "uset".
2262 */
2268
2274
2280
2286
2292
2298
2304
2310
2316
2322
2328
2329/* Return the universe in the space of "map".
2330 */
2332{
2333 isl_space *space;
2334
2335 space = isl_map_get_space(map);
2337 return isl_map_universe(space);
2338}
2339
2341{
2342 struct isl_un_op_control control = {
2343 .fn_map = &universe,
2344 };
2345 return un_op(umap, &control);
2346}
2347
2352
2354{
2355 struct isl_un_op_control control = {
2356 .fn_map = &isl_map_reverse,
2357 };
2358 return un_op(umap, &control);
2359}
2360
2361/* Given a union map, take the maps of the form (A -> B) -> C and
2362 * return the union of the corresponding maps (B -> A) -> C.
2363 */
2366{
2368 struct isl_un_op_control control = {
2369 .filter = &un_op_filter_drop_user,
2370 .filter_user = &data,
2371 .fn_map = &isl_map_domain_reverse,
2372 };
2373 return un_op(umap, &control);
2374}
2375
2376/* Given a union map, take the maps of the form A -> (B -> C) and
2377 * return the union of the corresponding maps A -> (C -> B).
2378 */
2381{
2383 struct isl_un_op_control control = {
2384 .filter = &un_op_filter_drop_user,
2385 .filter_user = &data,
2386 .fn_map = &isl_map_range_reverse,
2387 };
2388 return un_op(umap, &control);
2389}
2390
2391/* Compute the parameter domain of the given union map.
2392 */
2394{
2395 struct isl_un_op_control control = {
2396 .fn_map = &isl_map_params,
2397 };
2398 int empty;
2399
2400 empty = isl_union_map_is_empty(umap);
2401 if (empty < 0)
2402 goto error;
2403 if (empty) {
2404 isl_space *space;
2405 space = isl_union_map_get_space(umap);
2406 isl_union_map_free(umap);
2407 return isl_set_empty(space);
2408 }
2409 return isl_set_from_union_set(un_op(umap, &control));
2410error:
2411 isl_union_map_free(umap);
2412 return NULL;
2413}
2414
2415/* Compute the parameter domain of the given union set.
2416 */
2421
2423{
2424 struct isl_un_op_control control = {
2425 .fn_map = &isl_map_domain,
2426 };
2427 return un_op(umap, &control);
2428}
2429
2431{
2432 struct isl_un_op_control control = {
2433 .fn_map = &isl_map_range,
2434 };
2435 return un_op(umap, &control);
2436}
2437
2440{
2441 struct isl_un_op_control control = {
2442 .fn_map = &isl_map_domain_map,
2443 };
2444 return un_op(umap, &control);
2445}
2446
2447/* Construct an isl_pw_multi_aff that maps "map" to its domain and
2448 * add the result to "res".
2449 */
2463
2464/* Return an isl_union_pw_multi_aff that maps a wrapped copy of "umap"
2465 * to its domain.
2466 */
2479
2482{
2483 struct isl_un_op_control control = {
2484 .fn_map = &isl_map_range_map,
2485 };
2486 return un_op(umap, &control);
2487}
2488
2489/* Given a collection of wrapped maps of the form A[B -> C],
2490 * return the collection of maps A[B -> C] -> B.
2491 */
2494{
2496 struct isl_un_op_control control = {
2497 .filter = &un_op_filter_drop_user,
2498 .filter_user = &data,
2499 .fn_map = &isl_set_wrapped_domain_map,
2500 };
2501 return un_op(uset, &control);
2502}
2503
2504/* Does "map" relate elements from the same space?
2505 */
2510
2512{
2513 struct isl_un_op_control control = {
2514 .filter = &equal_tuples,
2515 .fn_map = &isl_map_deltas,
2516 };
2517 return un_op(umap, &control);
2518}
2519
2522{
2523 struct isl_un_op_control control = {
2524 .filter = &equal_tuples,
2525 .fn_map = &isl_map_deltas_map,
2526 };
2527 return un_op(umap, &control);
2528}
2529
2531{
2532 struct isl_un_op_control control = {
2533 .fn_map = &isl_set_identity,
2534 };
2535 return un_op(uset, &control);
2536}
2537
2538/* Construct an identity isl_pw_multi_aff on "set" and add it to *res.
2539 */
2553
2554/* Return an identity function on "uset" in the form
2555 * of an isl_union_pw_multi_aff.
2556 */
2569
2570/* For each map in "umap" of the form [A -> B] -> C,
2571 * construct the map A -> C and collect the results.
2572 */
2575{
2577 struct isl_un_op_control control = {
2578 .filter = &un_op_filter_drop_user,
2579 .filter_user = &data,
2581 };
2582 return un_op(umap, &control);
2583}
2584
2585/* For each map in "umap" of the form [A -> B] -> C,
2586 * construct the map B -> C and collect the results.
2587 */
2590{
2592 struct isl_un_op_control control = {
2593 .filter = &un_op_filter_drop_user,
2594 .filter_user = &data,
2595 .fn_map = &isl_map_domain_factor_range,
2596 };
2597 return un_op(umap, &control);
2598}
2599
2600/* For each map in "umap" of the form A -> [B -> C],
2601 * construct the map A -> B and collect the results.
2602 */
2605{
2607 struct isl_un_op_control control = {
2608 .filter = &un_op_filter_drop_user,
2609 .filter_user = &data,
2610 .fn_map = &isl_map_range_factor_domain,
2611 };
2612 return un_op(umap, &control);
2613}
2614
2615/* For each map in "umap" of the form A -> [B -> C],
2616 * construct the map A -> C and collect the results.
2617 */
2620{
2622 struct isl_un_op_control control = {
2623 .filter = &un_op_filter_drop_user,
2624 .filter_user = &data,
2625 .fn_map = &isl_map_range_factor_range,
2626 };
2627 return un_op(umap, &control);
2628}
2629
2630/* For each map in "umap" of the form [A -> B] -> [C -> D],
2631 * construct the map A -> C and collect the results.
2632 */
2635{
2637 struct isl_un_op_control control = {
2638 .filter = &un_op_filter_drop_user,
2639 .filter_user = &data,
2640 .fn_map = &isl_map_factor_domain,
2641 };
2642 return un_op(umap, &control);
2643}
2644
2645/* For each map in "umap" of the form [A -> B] -> [C -> D],
2646 * construct the map B -> D and collect the results.
2647 */
2650{
2652 struct isl_un_op_control control = {
2653 .filter = &un_op_filter_drop_user,
2654 .filter_user = &data,
2655 .fn_map = &isl_map_factor_range,
2656 };
2657 return un_op(umap, &control);
2658}
2659
2661{
2663 struct isl_un_op_control control = {
2664 .filter = &un_op_filter_drop_user,
2665 .filter_user = &data,
2666 .fn_map = &isl_set_unwrap,
2667 };
2668 return un_op(uset, &control);
2669}
2670
2672{
2673 struct isl_un_op_control control = {
2674 .fn_map = &isl_map_wrap,
2675 };
2676 return un_op(umap, &control);
2677}
2678
2683
2684static isl_stat is_subset_entry(void **entry, void *user)
2685{
2686 struct isl_union_map_is_subset_data *data = user;
2687 struct isl_hash_table_entry *entry2;
2688 isl_space *space;
2689 isl_map *map = *entry;
2690
2691 space = isl_map_peek_space(map);
2692 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
2693 if (!entry2)
2694 return isl_stat_error;
2695 if (entry2 == isl_hash_table_entry_none) {
2696 int empty = isl_map_is_empty(map);
2697 if (empty < 0)
2698 return isl_stat_error;
2699 if (empty)
2700 return isl_stat_ok;
2701 data->is_subset = isl_bool_false;
2702 return isl_stat_error;
2703 }
2704
2705 data->is_subset = isl_map_is_subset(map, entry2->data);
2706 if (data->is_subset < 0 || !data->is_subset)
2707 return isl_stat_error;
2708
2709 return isl_stat_ok;
2710}
2711
2714{
2715 struct isl_union_map_is_subset_data data = { NULL, isl_bool_true };
2716
2717 if (!umap1 || !umap2)
2718 return isl_bool_error;
2719
2720 data.umap2 = umap2;
2721 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
2722 &is_subset_entry, &data) < 0 &&
2723 data.is_subset)
2724 return isl_bool_error;
2725
2726 return data.is_subset;
2727}
2728
2734
2737{
2739
2740 if (!umap1 || !umap2)
2741 return isl_bool_error;
2743 if (is_subset != isl_bool_true)
2744 return is_subset;
2746 return is_subset;
2747}
2748
2754
2768
2774
2775/* Internal data structure for isl_union_map_is_disjoint.
2776 * umap2 is the union map with which we are comparing.
2777 * is_disjoint is initialized to 1 and is set to 0 as soon
2778 * as the union maps turn out not to be disjoint.
2779 */
2784
2785/* Check if "map" is disjoint from data->umap2 and abort
2786 * the search if it is not.
2787 */
2788static isl_stat is_disjoint_entry(void **entry, void *user)
2789{
2790 struct isl_union_map_is_disjoint_data *data = user;
2791 struct isl_hash_table_entry *entry2;
2792 isl_space *space;
2793 isl_map *map = *entry;
2794
2795 space = isl_map_peek_space(map);
2796 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
2797 if (!entry2)
2798 return isl_stat_error;
2799 if (entry2 == isl_hash_table_entry_none)
2800 return isl_stat_ok;
2801
2802 data->is_disjoint = isl_map_is_disjoint(map, entry2->data);
2803 if (data->is_disjoint < 0 || !data->is_disjoint)
2804 return isl_stat_error;
2805
2806 return isl_stat_ok;
2807}
2808
2809/* Are "umap1" and "umap2" disjoint?
2810 */
2813{
2814 struct isl_union_map_is_disjoint_data data = { NULL, isl_bool_true };
2815
2816 umap1 = isl_union_map_copy(umap1);
2818 umap1 = isl_union_map_align_params(umap1,
2822
2823 if (!umap1 || !umap2)
2824 goto error;
2825
2826 data.umap2 = umap2;
2827 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
2828 &is_disjoint_entry, &data) < 0 &&
2829 data.is_disjoint)
2830 goto error;
2831
2832 isl_union_map_free(umap1);
2834
2835 return data.is_disjoint;
2836error:
2837 isl_union_map_free(umap1);
2839 return isl_bool_error;
2840}
2841
2842/* Are "uset1" and "uset2" disjoint?
2843 */
2849
2850static isl_stat sample_entry(void **entry, void *user)
2851{
2852 isl_basic_map **sample = (isl_basic_map **)user;
2853 isl_map *map = *entry;
2854
2855 *sample = isl_map_sample(isl_map_copy(map));
2856 if (!*sample)
2857 return isl_stat_error;
2858 if (!isl_basic_map_plain_is_empty(*sample))
2859 return isl_stat_error;
2860 return isl_stat_ok;
2861}
2862
2864{
2865 isl_basic_map *sample = NULL;
2866
2867 if (!umap)
2868 return NULL;
2869
2870 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2871 &sample_entry, &sample) < 0 &&
2872 !sample)
2873 goto error;
2874
2875 if (!sample)
2877
2878 isl_union_map_free(umap);
2879
2880 return sample;
2881error:
2882 isl_union_map_free(umap);
2883 return NULL;
2884}
2885
2890
2891/* Return an element in "uset" in the form of an isl_point.
2892 * Return a void isl_point if "uset" is empty.
2893 */
2898
2903
2904static isl_stat forall_entry(void **entry, void *user)
2905{
2906 struct isl_forall_data *data = user;
2907 isl_map *map = *entry;
2908
2909 data->res = data->fn(map);
2910 if (data->res < 0)
2911 return isl_stat_error;
2912
2913 if (!data->res)
2914 return isl_stat_error;
2915
2916 return isl_stat_ok;
2917}
2918
2921{
2922 struct isl_forall_data data = { isl_bool_true, fn };
2923
2924 if (!umap)
2925 return isl_bool_error;
2926
2927 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2928 &forall_entry, &data) < 0 && data.res)
2929 return isl_bool_error;
2930
2931 return data.res;
2932}
2933
2939
2940static isl_stat forall_user_entry(void **entry, void *user)
2941{
2942 struct isl_forall_user_data *data = user;
2943 isl_map *map = *entry;
2944
2945 data->res = data->fn(map, data->user);
2946 if (data->res < 0)
2947 return isl_stat_error;
2948
2949 if (!data->res)
2950 return isl_stat_error;
2951
2952 return isl_stat_ok;
2953}
2954
2955/* Check if fn(map, user) returns true for all maps "map" in umap.
2956 */
2958 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user)
2959{
2960 struct isl_forall_user_data data = { isl_bool_true, fn, user };
2961
2962 if (!umap)
2963 return isl_bool_error;
2964
2965 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2966 &forall_user_entry, &data) < 0 && data.res)
2967 return isl_bool_error;
2968
2969 return data.res;
2970}
2971
2972/* Is "umap" obviously empty?
2973 */
2975{
2976 isl_size n;
2977
2978 n = isl_union_map_n_map(umap);
2979 if (n < 0)
2980 return isl_bool_error;
2981 return n == 0;
2982}
2983
2988
2993
2995{
2996 isl_bool is_subset;
2997 isl_space *space;
2998 isl_map *id;
3000
3002 if (match < 0)
3003 return isl_bool_error;
3004 if (!match)
3005 return isl_bool_false;
3006
3007 space = isl_map_get_space(map);
3008 id = isl_map_identity(space);
3009
3010 is_subset = isl_map_is_subset(map, id);
3011
3012 isl_map_free(id);
3013
3014 return is_subset;
3015}
3016
3017/* Given an isl_union_map that consists of a single map, check
3018 * if it is single-valued.
3019 */
3021{
3022 isl_map *map;
3023 isl_bool sv;
3024
3025 umap = isl_union_map_copy(umap);
3029
3030 return sv;
3031}
3032
3033/* Internal data structure for single_valued_on_domain.
3034 *
3035 * "umap" is the union map to be tested.
3036 * "sv" is set to 1 as long as "umap" may still be single-valued.
3037 */
3042
3043/* Check if the data->umap is single-valued on "set".
3044 *
3045 * If data->umap consists of a single map on "set", then test it
3046 * as an isl_map.
3047 *
3048 * Otherwise, compute
3049 *
3050 * M \circ M^-1
3051 *
3052 * check if the result is a subset of the identity mapping and
3053 * store the result in data->sv.
3054 *
3055 * Terminate as soon as data->umap has been determined not to
3056 * be single-valued.
3057 */
3059{
3060 struct isl_union_map_is_sv_data *data = user;
3062 isl_size n;
3063
3064 umap = isl_union_map_copy(data->umap);
3067
3069 if (n < 0) {
3070 data->sv = isl_bool_error;
3071 } else if (n == 1) {
3074 } else {
3077
3079
3081 }
3082
3083 if (data->sv < 0 || !data->sv)
3084 return isl_stat_error;
3085 return isl_stat_ok;
3086}
3087
3088/* Check if the given map is single-valued.
3089 *
3090 * If the union map consists of a single map, then test it as an isl_map.
3091 * Otherwise, check if the union map is single-valued on each of its
3092 * domain spaces.
3093 */
3095{
3098 struct isl_union_map_is_sv_data data;
3099 isl_size n;
3100
3102 if (n < 0)
3103 return isl_bool_error;
3104 if (n == 1)
3106
3109
3110 data.sv = isl_bool_true;
3111 data.umap = umap;
3113 &single_valued_on_domain, &data) < 0 && data.sv)
3114 data.sv = isl_bool_error;
3116
3117 return data.sv;
3118}
3119
3131
3132/* Is "map" obviously not an identity relation because
3133 * it maps elements from one space to another space?
3134 * Update *non_identity accordingly.
3135 *
3136 * In particular, if the domain and range spaces are the same,
3137 * then the map is not considered to obviously not be an identity relation.
3138 * Otherwise, the map is considered to obviously not be an identity relation
3139 * if it is is non-empty.
3140 *
3141 * If "map" is determined to obviously not be an identity relation,
3142 * then the search is aborted.
3143 */
3145{
3146 isl_bool *non_identity = user;
3148
3150 if (equal >= 0 && !equal)
3151 *non_identity = isl_bool_not(isl_map_is_empty(map));
3152 else
3153 *non_identity = isl_bool_not(equal);
3155
3156 if (*non_identity < 0 || *non_identity)
3157 return isl_stat_error;
3158
3159 return isl_stat_ok;
3160}
3161
3162/* Is "umap" obviously not an identity relation because
3163 * it maps elements from one space to another space?
3164 *
3165 * As soon as a map has been found that maps elements to a different space,
3166 * non_identity is changed and the search is aborted.
3167 */
3170{
3171 isl_bool non_identity;
3172
3173 non_identity = isl_bool_false;
3175 &non_identity) < 0 &&
3176 non_identity == isl_bool_false)
3177 return isl_bool_error;
3178
3179 return non_identity;
3180}
3181
3182/* Does "map" only map elements to themselves?
3183 * Update *identity accordingly.
3184 *
3185 * If "map" is determined not to be an identity relation,
3186 * then the search is aborted.
3187 */
3189{
3191
3194
3195 if (*identity < 0 || !*identity)
3196 return isl_stat_error;
3197
3198 return isl_stat_ok;
3199}
3200
3201/* Does "umap" only map elements to themselves?
3202 *
3203 * First check if there are any maps that map elements to different spaces.
3204 * If not, then check that all the maps (between identical spaces)
3205 * are identity relations.
3206 */
3208{
3209 isl_bool non_identity;
3211
3213 if (non_identity < 0 || non_identity)
3214 return isl_bool_not(non_identity);
3215
3219 return isl_bool_error;
3220
3221 return identity;
3222}
3223
3224/* Represents a map that has a fixed value (v) for one of its
3225 * range dimensions.
3226 * The map in this structure is not reference counted, so it
3227 * is only valid while the isl_union_map from which it was
3228 * obtained is still alive.
3229 */
3234
3236 int n)
3237{
3238 int i;
3239 struct isl_fixed_map *v;
3240
3241 v = isl_calloc_array(ctx, struct isl_fixed_map, n);
3242 if (!v)
3243 return NULL;
3244 for (i = 0; i < n; ++i)
3245 isl_int_init(v[i].v);
3246 return v;
3247}
3248
3250{
3251 int i;
3252
3253 if (!v)
3254 return;
3255 for (i = 0; i < n; ++i)
3256 isl_int_clear(v[i].v);
3257 free(v);
3258}
3259
3260/* Compare the "v" field of two isl_fixed_map structs.
3261 */
3262static int qsort_fixed_map_cmp(const void *p1, const void *p2)
3263{
3264 const struct isl_fixed_map *e1 = (const struct isl_fixed_map *) p1;
3265 const struct isl_fixed_map *e2 = (const struct isl_fixed_map *) p2;
3266
3267 return isl_int_cmp(e1->v, e2->v);
3268}
3269
3270/* Internal data structure used while checking whether all maps
3271 * in a union_map have a fixed value for a given output dimension.
3272 * v is the list of maps, with the fixed value for the dimension
3273 * n is the number of maps considered so far
3274 * pos is the output dimension under investigation
3275 */
3278 int n;
3279 int pos;
3280};
3281
3283{
3284 struct isl_fixed_dim_data *data = user;
3285
3286 data->v[data->n].map = map;
3288 &data->v[data->n++].v);
3289}
3290
3292 int first, int n_range);
3293
3294/* Given a list of the maps, with their fixed values at output dimension "pos",
3295 * check whether the ranges of the maps form an obvious partition.
3296 *
3297 * We first sort the maps according to their fixed values.
3298 * If all maps have a different value, then we know the ranges form
3299 * a partition.
3300 * Otherwise, we collect the maps with the same fixed value and
3301 * check whether each such collection is obviously injective
3302 * based on later dimensions.
3303 */
3304static int separates(struct isl_fixed_map *v, int n,
3305 __isl_take isl_space *space, int pos, int n_range)
3306{
3307 int i;
3308
3309 if (!v)
3310 goto error;
3311
3312 qsort(v, n, sizeof(*v), &qsort_fixed_map_cmp);
3313
3314 for (i = 0; i + 1 < n; ++i) {
3315 int j, k;
3316 isl_union_map *part;
3317 int injective;
3318
3319 for (j = i + 1; j < n; ++j)
3320 if (isl_int_ne(v[i].v, v[j].v))
3321 break;
3322
3323 if (j == i + 1)
3324 continue;
3325
3326 part = isl_union_map_alloc(isl_space_copy(space), j - i);
3327 for (k = i; k < j; ++k)
3328 part = isl_union_map_add_map(part,
3329 isl_map_copy(v[k].map));
3330
3331 injective = plain_injective_on_range(part, pos + 1, n_range);
3332 if (injective < 0)
3333 goto error;
3334 if (!injective)
3335 break;
3336
3337 i = j - 1;
3338 }
3339
3340 isl_space_free(space);
3342 return i + 1 >= n;
3343error:
3344 isl_space_free(space);
3346 return -1;
3347}
3348
3349/* Check whether the maps in umap have obviously distinct ranges.
3350 * In particular, check for an output dimension in the range
3351 * [first,n_range) for which all maps have a fixed value
3352 * and then check if these values, possibly along with fixed values
3353 * at later dimensions, entail distinct ranges.
3354 */
3356 int first, int n_range)
3357{
3358 isl_ctx *ctx;
3359 isl_size n;
3360 struct isl_fixed_dim_data data = { NULL };
3361
3362 ctx = isl_union_map_get_ctx(umap);
3363
3364 n = isl_union_map_n_map(umap);
3365 if (n < 0)
3366 goto error;
3367
3368 if (n <= 1) {
3369 isl_union_map_free(umap);
3370 return isl_bool_true;
3371 }
3372
3373 if (first >= n_range) {
3374 isl_union_map_free(umap);
3375 return isl_bool_false;
3376 }
3377
3378 data.v = alloc_isl_fixed_map_array(ctx, n);
3379 if (!data.v)
3380 goto error;
3381
3382 for (data.pos = first; data.pos < n_range; ++data.pos) {
3383 isl_bool fixed;
3384 int injective;
3385 isl_space *space;
3386
3387 data.n = 0;
3388 fixed = union_map_forall_user(umap, &fixed_at_pos, &data);
3389 if (fixed < 0)
3390 goto error;
3391 if (!fixed)
3392 continue;
3393 space = isl_union_map_get_space(umap);
3394 injective = separates(data.v, n, space, data.pos, n_range);
3395 isl_union_map_free(umap);
3396 return injective;
3397 }
3398
3400 isl_union_map_free(umap);
3401
3402 return isl_bool_false;
3403error:
3405 isl_union_map_free(umap);
3406 return isl_bool_error;
3407}
3408
3409/* Check whether the maps in umap that map to subsets of "ran"
3410 * have obviously distinct ranges.
3411 */
3413 void *user)
3414{
3415 isl_size dim;
3416 isl_union_map *umap = user;
3417
3418 dim = isl_set_dim(ran, isl_dim_set);
3419 if (dim < 0)
3420 return isl_bool_error;
3421
3422 umap = isl_union_map_copy(umap);
3425 return plain_injective_on_range(umap, 0, dim);
3426}
3427
3428/* Check if the given union_map is obviously injective.
3429 *
3430 * In particular, we first check if all individual maps are obviously
3431 * injective and then check if all the ranges of these maps are
3432 * obviously disjoint.
3433 */
3435{
3436 isl_bool in;
3437 isl_union_map *univ;
3438 isl_union_set *ran;
3439
3441 if (in < 0)
3442 return isl_bool_error;
3443 if (!in)
3444 return isl_bool_false;
3445
3447 ran = isl_union_map_range(univ);
3448
3450
3451 isl_union_set_free(ran);
3452
3453 return in;
3454}
3455
3457{
3458 isl_bool sv;
3459
3461 if (sv < 0 || !sv)
3462 return sv;
3463
3464 return isl_union_map_is_injective(umap);
3465}
3466
3468{
3469 struct isl_un_op_drop_user_data data = { &isl_map_can_zip };
3470 struct isl_un_op_control control = {
3471 .filter = &un_op_filter_drop_user,
3472 .filter_user = &data,
3473 .fn_map = &isl_map_zip,
3474 };
3475 return un_op(umap, &control);
3476}
3477
3478/* Given a union map, take the maps of the form A -> (B -> C) and
3479 * return the union of the corresponding maps (A -> B) -> C.
3480 */
3482{
3484 struct isl_un_op_control control = {
3485 .filter = &un_op_filter_drop_user,
3486 .filter_user = &data,
3487 .fn_map = &isl_map_uncurry,
3488 };
3489 return un_op(umap, &control);
3490}
3491
3492/* Given a union map, take the maps of the form (A -> B) -> C and
3493 * return the union of the corresponding maps A -> (B -> C).
3494 */
3496{
3498 struct isl_un_op_control control = {
3499 .filter = &un_op_filter_drop_user,
3500 .filter_user = &data,
3501 .fn_map = &isl_map_curry,
3502 };
3503 return un_op(umap, &control);
3504}
3505
3506/* Given a union map, take the maps of the form A -> ((B -> C) -> D) and
3507 * return the union of the corresponding maps A -> (B -> (C -> D)).
3508 */
3511{
3513 struct isl_un_op_control control = {
3514 .filter = &un_op_filter_drop_user,
3515 .filter_user = &data,
3516 .fn_map = &isl_map_range_curry,
3517 };
3518 return un_op(umap, &control);
3519}
3520
3522{
3523 struct isl_un_op_control control = {
3524 .fn_map = &isl_set_lift,
3525 };
3526 return un_op(uset, &control);
3527}
3528
3529static isl_stat coefficients_entry(void **entry, void *user)
3530{
3531 isl_set *set = *entry;
3533
3534 set = isl_set_copy(set);
3537
3538 return isl_stat_ok;
3539}
3540
3543{
3544 isl_ctx *ctx;
3545 isl_space *space;
3547
3548 if (!uset)
3549 return NULL;
3550
3551 ctx = isl_union_set_get_ctx(uset);
3552 space = isl_space_set_alloc(ctx, 0, 0);
3553 res = isl_union_map_alloc(space, uset->table.n);
3554 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table,
3555 &coefficients_entry, &res) < 0)
3556 goto error;
3557
3558 isl_union_set_free(uset);
3559 return res;
3560error:
3561 isl_union_set_free(uset);
3563 return NULL;
3564}
3565
3566static isl_stat solutions_entry(void **entry, void *user)
3567{
3568 isl_set *set = *entry;
3570
3571 set = isl_set_copy(set);
3573 if (!*res)
3575 else
3577
3578 if (!*res)
3579 return isl_stat_error;
3580
3581 return isl_stat_ok;
3582}
3583
3586{
3587 isl_union_set *res = NULL;
3588
3589 if (!uset)
3590 return NULL;
3591
3592 if (uset->table.n == 0) {
3594 isl_union_set_free(uset);
3595 return res;
3596 }
3597
3598 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table,
3599 &solutions_entry, &res) < 0)
3600 goto error;
3601
3602 isl_union_set_free(uset);
3603 return res;
3604error:
3605 isl_union_set_free(uset);
3607 return NULL;
3608}
3609
3610/* Is the domain space of "map" equal to "space"?
3611 */
3617
3618/* Is the range space of "map" equal to "space"?
3619 */
3625
3626/* Is the set space of "map" equal to "space"?
3627 */
3629{
3631 space, isl_dim_out);
3632}
3633
3634/* Internal data structure for preimage_pw_multi_aff.
3635 *
3636 * "pma" is the function under which the preimage should be taken.
3637 * "space" is the space of "pma".
3638 * "res" collects the results.
3639 * "fn" computes the preimage for a given map.
3640 * "match" returns true if "fn" can be called.
3641 */
3650
3651/* Call data->fn to compute the preimage of the domain or range of *entry
3652 * under the function represented by data->pma, provided the domain/range
3653 * space of *entry matches the target space of data->pma
3654 * (as given by data->match), and add the result to data->res.
3655 */
3656static isl_stat preimage_entry(void **entry, void *user)
3657{
3658 int m;
3659 isl_map *map = *entry;
3660 struct isl_union_map_preimage_data *data = user;
3661 isl_bool empty;
3662
3663 m = data->match(map, data->space);
3664 if (m < 0)
3665 return isl_stat_error;
3666 if (!m)
3667 return isl_stat_ok;
3668
3669 map = isl_map_copy(map);
3670 map = data->fn(map, isl_pw_multi_aff_copy(data->pma));
3671
3672 empty = isl_map_is_empty(map);
3673 if (empty < 0 || empty) {
3675 return empty < 0 ? isl_stat_error : isl_stat_ok;
3676 }
3677
3678 data->res = isl_union_map_add_map(data->res, map);
3679
3680 return isl_stat_ok;
3681}
3682
3683/* Compute the preimage of the domain or range of "umap" under the function
3684 * represented by "pma".
3685 * In other words, plug in "pma" in the domain or range of "umap".
3686 * The function "fn" performs the actual preimage computation on a map,
3687 * while "match" determines to which maps the function should be applied.
3688 */
3694{
3695 isl_ctx *ctx;
3697 struct isl_union_map_preimage_data data;
3698
3699 umap = isl_union_map_align_params(umap,
3702
3703 if (!umap || !pma)
3704 goto error;
3705
3706 ctx = isl_union_map_get_ctx(umap);
3709 data.pma = pma;
3710 data.res = isl_union_map_alloc(space, umap->table.n);
3711 data.match = match;
3712 data.fn = fn;
3713 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_entry,
3714 &data) < 0)
3715 data.res = isl_union_map_free(data.res);
3716
3717 isl_space_free(data.space);
3718 isl_union_map_free(umap);
3720 return data.res;
3721error:
3722 isl_union_map_free(umap);
3724 return NULL;
3725}
3726
3727/* Compute the preimage of the domain of "umap" under the function
3728 * represented by "pma".
3729 * In other words, plug in "pma" in the domain of "umap".
3730 * The result contains maps that live in the same spaces as the maps of "umap"
3731 * with domain space equal to the target space of "pma",
3732 * except that the domain has been replaced by the domain space of "pma".
3733 */
3740
3741/* Compute the preimage of the range of "umap" under the function
3742 * represented by "pma".
3743 * In other words, plug in "pma" in the range of "umap".
3744 * The result contains maps that live in the same spaces as the maps of "umap"
3745 * with range space equal to the target space of "pma",
3746 * except that the range has been replaced by the domain space of "pma".
3747 */
3754
3755/* Compute the preimage of "uset" under the function represented by "pma".
3756 * In other words, plug in "pma" in "uset".
3757 * The result contains sets that live in the same spaces as the sets of "uset"
3758 * with space equal to the target space of "pma",
3759 * except that the space has been replaced by the domain space of "pma".
3760 */
3767
3768/* Compute the preimage of the domain of "umap" under the function
3769 * represented by "ma".
3770 * In other words, plug in "ma" in the domain of "umap".
3771 * The result contains maps that live in the same spaces as the maps of "umap"
3772 * with domain space equal to the target space of "ma",
3773 * except that the domain has been replaced by the domain space of "ma".
3774 */
3781
3782/* Compute the preimage of the range of "umap" under the function
3783 * represented by "ma".
3784 * In other words, plug in "ma" in the range of "umap".
3785 * The result contains maps that live in the same spaces as the maps of "umap"
3786 * with range space equal to the target space of "ma",
3787 * except that the range has been replaced by the domain space of "ma".
3788 */
3795
3796/* Compute the preimage of "uset" under the function represented by "ma".
3797 * In other words, plug in "ma" in "uset".
3798 * The result contains sets that live in the same spaces as the sets of "uset"
3799 * with space equal to the target space of "ma",
3800 * except that the space has been replaced by the domain space of "ma".
3801 */
3808
3809/* Internal data structure for preimage_multi_pw_aff.
3810 *
3811 * "mpa" is the function under which the preimage should be taken.
3812 * "space" is the space of "mpa".
3813 * "res" collects the results.
3814 * "fn" computes the preimage for a given map.
3815 * "match" returns true if "fn" can be called.
3816 */
3825
3826/* Call data->fn to compute the preimage of the domain or range of *entry
3827 * under the function represented by data->mpa, provided the domain/range
3828 * space of *entry matches the target space of data->mpa
3829 * (as given by data->match), and add the result to data->res.
3830 */
3831static isl_stat preimage_mpa_entry(void **entry, void *user)
3832{
3833 int m;
3834 isl_map *map = *entry;
3836 isl_bool empty;
3837
3838 m = data->match(map, data->space);
3839 if (m < 0)
3840 return isl_stat_error;
3841 if (!m)
3842 return isl_stat_ok;
3843
3844 map = isl_map_copy(map);
3845 map = data->fn(map, isl_multi_pw_aff_copy(data->mpa));
3846
3847 empty = isl_map_is_empty(map);
3848 if (empty < 0 || empty) {
3850 return empty < 0 ? isl_stat_error : isl_stat_ok;
3851 }
3852
3853 data->res = isl_union_map_add_map(data->res, map);
3854
3855 return isl_stat_ok;
3856}
3857
3858/* Compute the preimage of the domain or range of "umap" under the function
3859 * represented by "mpa".
3860 * In other words, plug in "mpa" in the domain or range of "umap".
3861 * The function "fn" performs the actual preimage computation on a map,
3862 * while "match" determines to which maps the function should be applied.
3863 */
3869{
3870 isl_ctx *ctx;
3873
3874 umap = isl_union_map_align_params(umap,
3875 isl_multi_pw_aff_get_space(mpa));
3876 mpa = isl_multi_pw_aff_align_params(mpa, isl_union_map_get_space(umap));
3877
3878 if (!umap || !mpa)
3879 goto error;
3880
3881 ctx = isl_union_map_get_ctx(umap);
3883 data.space = isl_multi_pw_aff_get_space(mpa);
3884 data.mpa = mpa;
3885 data.res = isl_union_map_alloc(space, umap->table.n);
3886 data.match = match;
3887 data.fn = fn;
3888 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_mpa_entry,
3889 &data) < 0)
3890 data.res = isl_union_map_free(data.res);
3891
3892 isl_space_free(data.space);
3893 isl_union_map_free(umap);
3894 isl_multi_pw_aff_free(mpa);
3895 return data.res;
3896error:
3897 isl_union_map_free(umap);
3898 isl_multi_pw_aff_free(mpa);
3899 return NULL;
3900}
3901
3902/* Compute the preimage of the domain of "umap" under the function
3903 * represented by "mpa".
3904 * In other words, plug in "mpa" in the domain of "umap".
3905 * The result contains maps that live in the same spaces as the maps of "umap"
3906 * with domain space equal to the target space of "mpa",
3907 * except that the domain has been replaced by the domain space of "mpa".
3908 */
3915
3916/* Internal data structure for preimage_upma.
3917 *
3918 * "umap" is the map of which the preimage should be computed.
3919 * "res" collects the results.
3920 * "fn" computes the preimage for a given piecewise multi-affine function.
3921 */
3928
3929/* Call data->fn to compute the preimage of the domain or range of data->umap
3930 * under the function represented by pma and add the result to data->res.
3931 */
3933{
3936
3937 umap = isl_union_map_copy(data->umap);
3938 umap = data->fn(umap, pma);
3939 data->res = isl_union_map_union(data->res, umap);
3940
3941 return data->res ? isl_stat_ok : isl_stat_error;
3942}
3943
3944/* Compute the preimage of the domain or range of "umap" under the function
3945 * represented by "upma".
3946 * In other words, plug in "upma" in the domain or range of "umap".
3947 * The function "fn" performs the actual preimage computation
3948 * on a piecewise multi-affine function.
3949 */
3970
3971/* Compute the preimage of the domain of "umap" under the function
3972 * represented by "upma".
3973 * In other words, plug in "upma" in the domain of "umap".
3974 * The result contains maps that live in the same spaces as the maps of "umap"
3975 * with domain space equal to one of the target spaces of "upma",
3976 * except that the domain has been replaced by one of the domain spaces that
3977 * correspond to that target space of "upma".
3978 */
3986
3987/* Compute the preimage of the range of "umap" under the function
3988 * represented by "upma".
3989 * In other words, plug in "upma" in the range of "umap".
3990 * The result contains maps that live in the same spaces as the maps of "umap"
3991 * with range space equal to one of the target spaces of "upma",
3992 * except that the range has been replaced by one of the domain spaces that
3993 * correspond to that target space of "upma".
3994 */
4002
4003/* Compute the preimage of "uset" under the function represented by "upma".
4004 * In other words, plug in "upma" in the range of "uset".
4005 * The result contains sets that live in the same spaces as the sets of "uset"
4006 * with space equal to one of the target spaces of "upma",
4007 * except that the space has been replaced by one of the domain spaces that
4008 * correspond to that target space of "upma".
4009 */
4017
4018/* Reset the user pointer on all identifiers of parameters and tuples
4019 * of the spaces of "umap".
4020 */
4023{
4025 if (!umap)
4026 return NULL;
4028 if (!umap->dim)
4029 return isl_union_map_free(umap);
4030 return total(umap, &isl_map_reset_user);
4031}
4032
4033/* Reset the user pointer on all identifiers of parameters and tuples
4034 * of the spaces of "uset".
4035 */
4041
4042/* Remove all existentially quantified variables and integer divisions
4043 * from "umap" using Fourier-Motzkin elimination.
4044 */
4050
4051/* Remove all existentially quantified variables and integer divisions
4052 * from "uset" using Fourier-Motzkin elimination.
4053 */
4059
4060/* Internal data structure for isl_union_map_project_out.
4061 * "type", "first" and "n" are the arguments for the isl_map_project_out
4062 * call.
4063 * "res" collects the results.
4064 */
4072
4073/* Turn the data->n dimensions of type data->type, starting at data->first
4074 * into existentially quantified variables and add the result to data->res.
4075 */
4077{
4078 struct isl_union_map_project_out_data *data = user;
4079
4080 map = isl_map_project_out(map, data->type, data->first, data->n);
4081 data->res = isl_union_map_add_map(data->res, map);
4082
4083 return isl_stat_ok;
4084}
4085
4086/* Turn the "n" dimensions of type "type", starting at "first"
4087 * into existentially quantified variables.
4088 * Since the space of an isl_union_map only contains parameters,
4089 * type is required to be equal to isl_dim_param.
4090 */
4093 enum isl_dim_type type, unsigned first, unsigned n)
4094{
4095 isl_space *space;
4096 struct isl_union_map_project_out_data data = { type, first, n };
4097
4098 if (!umap)
4099 return NULL;
4100
4101 if (type != isl_dim_param)
4103 "can only project out parameters",
4104 return isl_union_map_free(umap));
4105
4106 space = isl_union_map_get_space(umap);
4107 space = isl_space_drop_dims(space, type, first, n);
4108 data.res = isl_union_map_empty(space);
4109 if (isl_union_map_foreach_map(umap, &project_out, &data) < 0)
4110 data.res = isl_union_map_free(data.res);
4111
4112 isl_union_map_free(umap);
4113
4114 return data.res;
4115}
4116
4117#undef TYPE
4118#define TYPE isl_union_map
4121
4122/* Turn the "n" dimensions of type "type", starting at "first"
4123 * into existentially quantified variables.
4124 * Since the space of an isl_union_set only contains parameters,
4125 * "type" is required to be equal to isl_dim_param.
4126 */
4129 enum isl_dim_type type, unsigned first, unsigned n)
4130{
4131 return isl_union_map_project_out(uset, type, first, n);
4132}
4133
4134/* Project out all parameters from "uset" by existentially quantifying
4135 * over them.
4136 */
4143
4144/* Internal data structure for isl_union_map_involves_dims.
4145 * "first" and "n" are the arguments for the isl_map_involves_dims calls.
4146 */
4148 unsigned first;
4149 unsigned n;
4150};
4151
4152/* Does "map" _not_ involve the data->n parameters starting at data->first?
4153 */
4155{
4157 isl_bool involves;
4158
4159 involves = isl_map_involves_dims(map,
4160 isl_dim_param, data->first, data->n);
4161 return isl_bool_not(involves);
4162}
4163
4164/* Does "umap" involve any of the n parameters starting at first?
4165 * "type" is required to be set to isl_dim_param.
4166 *
4167 * "umap" involves any of those parameters if any of its maps
4168 * involve the parameters. In other words, "umap" does not
4169 * involve any of the parameters if all its maps to not
4170 * involve the parameters.
4171 */
4173 enum isl_dim_type type, unsigned first, unsigned n)
4174{
4175 struct isl_union_map_involves_dims_data data = { first, n };
4176 isl_bool excludes;
4177
4178 if (type != isl_dim_param)
4180 "can only reference parameters", return isl_bool_error);
4181
4182 excludes = union_map_forall_user(umap, &map_excludes, &data);
4183
4184 return isl_bool_not(excludes);
4185}
4186
4187/* Internal data structure for isl_union_map_reset_range_space.
4188 * "range" is the space from which to set the range space.
4189 * "res" collects the results.
4190 */
4195
4196/* Replace the range space of "map" by the range space of data->range and
4197 * add the result to data->res.
4198 */
4200{
4202 isl_space *space;
4203
4204 space = isl_map_get_space(map);
4205 space = isl_space_domain(space);
4207 isl_space_copy(data->range));
4208 map = isl_map_reset_space(map, space);
4209 data->res = isl_union_map_add_map(data->res, map);
4210
4211 return data->res ? isl_stat_ok : isl_stat_error;
4212}
4213
4214/* Replace the range space of all the maps in "umap" by
4215 * the range space of "space".
4216 *
4217 * This assumes that all maps have the same output dimension.
4218 * This function should therefore not be made publicly available.
4219 *
4220 * Since the spaces of the maps change, so do their hash value.
4221 * We therefore need to create a new isl_union_map.
4222 */
4225{
4226 struct isl_union_map_reset_range_space_data data = { space };
4227
4229 if (isl_union_map_foreach_map(umap, &reset_range_space, &data) < 0)
4230 data.res = isl_union_map_free(data.res);
4231
4232 isl_space_free(space);
4233 isl_union_map_free(umap);
4234 return data.res;
4235}
4236
4237/* Check that "umap" and "space" have the same number of parameters.
4238 */
4240 __isl_keep isl_space *space)
4241{
4242 isl_size dim1, dim2;
4243
4244 dim1 = isl_union_map_dim(umap, isl_dim_param);
4245 dim2 = isl_space_dim(space, isl_dim_param);
4246 if (dim1 < 0 || dim2 < 0)
4247 return isl_stat_error;
4248 if (dim1 == dim2)
4249 return isl_stat_ok;
4251 "number of parameters does not match", return isl_stat_error);
4252}
4253
4254/* Internal data structure for isl_union_map_reset_equal_dim_space.
4255 * "space" is the target space.
4256 * "res" collects the results.
4257 */
4262
4263/* Replace the parameters of "map" by those of data->space and
4264 * add the result to data->res.
4265 */
4267{
4270
4274 data->res = isl_union_map_add_map(data->res, map);
4275
4276 return data->res ? isl_stat_ok : isl_stat_error;
4277}
4278
4279/* Replace the space of "umap" by "space", without modifying
4280 * the dimension of "umap", i.e., the number of parameters of "umap".
4281 *
4282 * Since the hash values of the maps in the union map depend
4283 * on the parameters, a new union map needs to be constructed.
4284 */
4287{
4288 struct isl_union_map_reset_params_data data = { space };
4290 isl_space *umap_space;
4291
4292 umap_space = isl_union_map_peek_space(umap);
4293 equal = isl_space_is_equal(umap_space, space);
4294 if (equal < 0)
4295 goto error;
4296 if (equal) {
4298 return umap;
4299 }
4301 goto error;
4302
4304 if (isl_union_map_foreach_map(umap, &reset_params, &data) < 0)
4305 data.res = isl_union_map_free(data.res);
4306
4308 isl_union_map_free(umap);
4309 return data.res;
4310error:
4311 isl_union_map_free(umap);
4313 return NULL;
4314}
4315
4316/* Internal data structure for isl_union_map_order_at_multi_union_pw_aff.
4317 * "mupa" is the function from which the isl_multi_pw_affs are extracted.
4318 * "order" is applied to the extracted isl_multi_pw_affs that correspond
4319 * to the domain and the range of each map.
4320 * "res" collects the results.
4321 */
4328
4329/* Intersect "map" with the result of applying data->order to
4330 * the functions in data->mupa that apply to the domain and the range
4331 * of "map" and add the result to data->res.
4332 */
4334{
4335 struct isl_union_order_at_data *data = user;
4336 isl_space *space;
4337 isl_multi_pw_aff *mpa1, *mpa2;
4338 isl_map *order;
4339
4344 order = data->order(mpa1, mpa2);
4346 data->res = isl_union_map_add_map(data->res, map);
4347
4348 return data->res ? isl_stat_ok : isl_stat_error;
4349}
4350
4351/* If "mupa" has a non-trivial explicit domain, then intersect
4352 * domain and range of "umap" with this explicit domain.
4353 * If the explicit domain only describes constraints on the parameters,
4354 * then the intersection only needs to be performed once.
4355 */
4358{
4359 isl_bool non_trivial, is_params;
4360 isl_union_set *dom;
4361
4363 if (non_trivial < 0)
4364 return isl_union_map_free(umap);
4365 if (!non_trivial)
4366 return umap;
4367 mupa = isl_multi_union_pw_aff_copy(mupa);
4369 is_params = isl_union_set_is_params(dom);
4370 if (is_params < 0) {
4371 isl_union_set_free(dom);
4372 return isl_union_map_free(umap);
4373 }
4374 if (is_params) {
4375 isl_set *set;
4376
4378 umap = isl_union_map_intersect_params(umap, set);
4379 return umap;
4380 }
4382 umap = isl_union_map_intersect_range(umap, dom);
4383 return umap;
4384}
4385
4386/* Intersect each map in "umap" with the result of calling "order"
4387 * on the functions is "mupa" that apply to the domain and the range
4388 * of the map.
4389 */
4394{
4395 struct isl_union_order_at_data data;
4396
4397 umap = isl_union_map_align_params(umap,
4398 isl_multi_union_pw_aff_get_space(mupa));
4399 mupa = isl_multi_union_pw_aff_align_params(mupa,
4401 umap = intersect_explicit_domain(umap, mupa);
4402 data.mupa = mupa;
4403 data.order = order;
4405 if (isl_union_map_foreach_map(umap, &order_at, &data) < 0)
4406 data.res = isl_union_map_free(data.res);
4407
4408 isl_multi_union_pw_aff_free(mupa);
4409 isl_union_map_free(umap);
4410 return data.res;
4411}
4412
4413/* Return the subset of "umap" where the domain and the range
4414 * have equal "mupa" values.
4415 */
4423
4424#undef ORDER
4425#define ORDER le
4427
4428#undef ORDER
4429#define ORDER lt
4431
4432#undef ORDER
4433#define ORDER ge
4435
4436#undef ORDER
4437#define ORDER gt
4439
4440/* Return the union of the elements in the list "list".
4441 */
4444{
4445 int i;
4446 isl_size n;
4447 isl_ctx *ctx;
4448 isl_space *space;
4450
4451 n = isl_union_set_list_n_union_set(list);
4452 if (n < 0)
4453 goto error;
4454
4455 ctx = isl_union_set_list_get_ctx(list);
4456 space = isl_space_params_alloc(ctx, 0);
4457 res = isl_union_set_empty(space);
4458
4459 for (i = 0; i < n; ++i) {
4460 isl_union_set *uset_i;
4461
4462 uset_i = isl_union_set_list_get_union_set(list, i);
4463 res = isl_union_set_union(res, uset_i);
4464 }
4465
4466 isl_union_set_list_free(list);
4467 return res;
4468error:
4469 isl_union_set_list_free(list);
4470 return NULL;
4471}
4472
4473/* Update *hash with the hash value of "map".
4474 */
4476{
4477 uint32_t *hash = user;
4478 uint32_t map_hash;
4479
4480 map_hash = isl_map_get_hash(map);
4481 isl_hash_hash(*hash, map_hash);
4482
4484 return isl_stat_ok;
4485}
4486
4487/* Return a hash value that digests "umap".
4488 */
4490{
4491 uint32_t hash;
4492
4493 if (!umap)
4494 return 0;
4495
4496 hash = isl_hash_init();
4497 if (isl_union_map_foreach_map(umap, &add_hash, &hash) < 0)
4498 return 0;
4499
4500 return hash;
4501}
4502
4503/* Return a hash value that digests "uset".
4504 */
4506{
4507 return isl_union_map_get_hash(uset);
4508}
4509
4510/* Add the number of basic sets in "set" to "n".
4511 */
4513{
4514 int *n = user;
4515 isl_size set_n;
4516
4517 set_n = isl_set_n_basic_set(set);
4518 *n += set_n;
4520
4521 return set_n < 0 ? isl_stat_error : isl_stat_ok;
4522}
4523
4524/* Return the total number of basic sets in "uset".
4525 */
4527{
4528 int n = 0;
4529
4530 if (isl_union_set_foreach_set(uset, &add_n, &n) < 0)
4531 return -1;
4532
4533 return n;
4534}
4535
4536/* Add the basic sets in "set" to "list".
4537 */
4539{
4540 isl_basic_set_list **list = user;
4541 isl_basic_set_list *list_i;
4542
4544 *list = isl_basic_set_list_concat(*list, list_i);
4546
4547 if (!*list)
4548 return isl_stat_error;
4549 return isl_stat_ok;
4550}
4551
4552/* Return a list containing all the basic sets in "uset".
4553 *
4554 * First construct a list of the appropriate size and
4555 * then add all the elements.
4556 */
4559{
4560 int n;
4561 isl_ctx *ctx;
4562 isl_basic_set_list *list;
4563
4564 if (!uset)
4565 return NULL;
4566 ctx = isl_union_set_get_ctx(uset);
4568 if (n < 0)
4569 return NULL;
4570 list = isl_basic_set_list_alloc(ctx, n);
4571 if (isl_union_set_foreach_set(uset, &add_list, &list) < 0)
4572 list = isl_basic_set_list_free(list);
4573
4574 return list;
4575}
4576
4577/* Internal data structure for isl_union_map_remove_map_if.
4578 * "fn" and "user" are the arguments to isl_union_map_remove_map_if.
4579 */
4584
4585/* isl_un_op_control filter that negates the result of data->fn
4586 * called on "map".
4587 */
4589{
4591
4592 return isl_bool_not(data->fn(map, data->user));
4593}
4594
4595/* Dummy isl_un_op_control transformation callback that
4596 * simply returns the input.
4597 */
4599{
4600 return map;
4601}
4602
4603/* Call "fn" on every map in "umap" and remove those maps
4604 * for which the callback returns true.
4605 *
4606 * Use un_op to keep only those maps that are not filtered out,
4607 * applying an identity transformation on them.
4608 */
4611 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user)
4612{
4613 struct isl_union_map_remove_map_if_data data = { fn, user };
4614 struct isl_un_op_control control = {
4615 .filter = &not,
4616 .filter_user = &data,
4617 .fn_map = &map_id,
4618 };
4619 return un_op(umap, &control);
4620}
4621
4622/* Does "map" have "space" as domain (ignoring parameters)?
4623 */
4625{
4626 isl_space *space = user;
4627
4629}
4630
4631/* Does "map" have "space" as range (ignoring parameters)?
4632 */
4634{
4635 isl_space *space = user;
4636
4638}
4639
4640/* Wrapper around isl_map_bind_range for use as a un_op callback.
4641 */
4643{
4645
4646 return isl_map_bind_range(map, isl_multi_id_copy(tuple));
4647}
4648
4649/* Bind the output dimensions of "umap" to parameters with identifiers
4650 * specified by "tuple", living in the range space of "umap",
4651 * for those maps that have a matching range space.
4652 */
4655{
4656 struct isl_un_op_control control = {
4657 .filter = &has_range_space_tuples,
4658 .filter_user = isl_multi_id_peek_space(tuple),
4659 .fn_map2 = &bind_range,
4660 .fn_map2_user = tuple,
4661 };
4663
4664 bound = uset_from_umap(un_op(umap, &control));
4665 isl_multi_id_free(tuple);
4666 return bound;
4667}
4668
4669/* Only keep those elements in "umap" that have a domain in "space".
4670 */
4673{
4674 struct isl_un_op_control control = {
4675 .filter = &has_domain_space_tuples,
4676 .filter_user = space,
4677 };
4678
4679 umap = un_op(umap, &control);
4680 isl_space_free(space);
4681 return umap;
4682}
4683
4684/* Only keep those elements in "umap" that have a range in "space".
4685 */
4688{
4689 struct isl_un_op_control control = {
4690 .filter = &has_range_space_tuples,
4691 .filter_user = space,
4692 };
4693
4694 umap = un_op(umap, &control);
4695 isl_space_free(space);
4696 return umap;
4697}
__isl_constructor __isl_give isl_pw_multi_aff * isl_pw_multi_aff_from_multi_aff(__isl_take isl_multi_aff *ma)
__isl_export __isl_give isl_space * isl_pw_multi_aff_get_space(__isl_keep isl_pw_multi_aff *pma)
__isl_null isl_union_pw_multi_aff * isl_union_pw_multi_aff_free(__isl_take isl_union_pw_multi_aff *upma)
__isl_give isl_pw_multi_aff * isl_pw_multi_aff_align_params(__isl_take isl_pw_multi_aff *pma, __isl_take isl_space *model)
__isl_export __isl_give isl_multi_aff * isl_multi_aff_domain_map(__isl_take isl_space *space)
Definition isl_aff.c:4248
__isl_export __isl_give isl_pw_multi_aff * isl_pw_multi_aff_intersect_domain(__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set)
__isl_export __isl_give isl_union_set * isl_multi_union_pw_aff_domain(__isl_take isl_multi_union_pw_aff *mupa)
Definition isl_aff.c:9393
__isl_give isl_multi_pw_aff * isl_multi_union_pw_aff_extract_multi_pw_aff(__isl_keep isl_multi_union_pw_aff *mupa, __isl_take isl_space *space)
Definition isl_aff.c:9856
__isl_give isl_map * isl_multi_pw_aff_eq_map(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2)
Definition isl_aff.c:7542
isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff(__isl_keep isl_union_pw_multi_aff *upma, isl_stat(*fn)(__isl_take isl_pw_multi_aff *pma, void *user), void *user)
__isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_empty(__isl_take isl_space *space)
__isl_give isl_union_pw_multi_aff * isl_union_pw_multi_aff_add_pw_multi_aff(__isl_take isl_union_pw_multi_aff *upma, __isl_take isl_pw_multi_aff *pma)
__isl_null isl_pw_multi_aff * isl_pw_multi_aff_free(__isl_take isl_pw_multi_aff *pma)
__isl_give isl_pw_multi_aff * isl_pw_multi_aff_copy(__isl_keep isl_pw_multi_aff *pma)
__isl_give isl_pw_multi_aff * isl_pw_multi_aff_identity(__isl_take isl_space *space)
Definition isl_aff.c:4471
__isl_give isl_pw_multi_aff * isl_pw_multi_aff_alloc(__isl_take isl_set *set, __isl_take isl_multi_aff *maff)
struct isl_union_pw_multi_aff isl_union_pw_multi_aff
Definition aff_type.h:38
struct isl_multi_aff isl_multi_aff
Definition aff_type.h:29
struct isl_multi_pw_aff isl_multi_pw_aff
Definition aff_type.h:43
struct isl_multi_union_pw_aff isl_multi_union_pw_aff
Definition aff_type.h:46
static __isl_give isl_basic_set * bset_from_bmap(__isl_take isl_basic_map *bmap)
#define __isl_take
Definition ctx.h:23
#define isl_calloc_type(ctx, type)
Definition ctx.h:131
isl_stat
Definition ctx.h:85
@ isl_stat_error
Definition ctx.h:86
@ isl_stat_ok
Definition ctx.h:87
#define __isl_give
Definition ctx.h:20
#define isl_size_error
Definition ctx.h:99
#define __isl_null
Definition ctx.h:29
#define isl_die(ctx, errno, msg, code)
Definition ctx.h:139
isl_bool isl_bool_ok(int b)
Definition isl_ctx.c:58
@ isl_error_invalid
Definition ctx.h:81
@ isl_error_internal
Definition ctx.h:80
#define isl_calloc_array(ctx, type, n)
Definition ctx.h:134
#define __isl_keep
Definition ctx.h:26
int isl_size
Definition ctx.h:98
isl_bool isl_bool_not(isl_bool b)
Definition isl_ctx.c:44
isl_bool
Definition ctx.h:90
@ isl_bool_false
Definition ctx.h:92
@ isl_bool_true
Definition ctx.h:93
@ isl_bool_error
Definition ctx.h:91
m
Definition guard1-0.c:2
#define isl_hash_hash(h, h2)
Definition hash.h:26
void isl_hash_table_clear(struct isl_hash_table *table)
Definition isl_hash.c:136
struct isl_hash_table_entry * isl_hash_table_entry_none
Definition isl_hash.c:155
#define isl_hash_init()
Definition hash.h:21
int isl_hash_table_init(struct isl_ctx *ctx, struct isl_hash_table *table, int min_size)
Definition isl_hash.c:42
isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table, isl_stat(*fn)(void **entry, void *user), void *user)
Definition isl_hash.c:215
struct isl_hash_table_entry * isl_hash_table_find(struct isl_ctx *ctx, struct isl_hash_table *table, uint32_t key_hash, isl_bool(*eq)(const void *entry, const void *val), const void *val, int reserve)
Definition isl_hash.c:157
__isl_export __isl_give ISL_HMAP __isl_take ISL_KEY __isl_take ISL_VAL * val
Definition hmap.h:32
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
Definition hmap.h:37
isl_stat isl_stat void * user
Definition hmap.h:39
isl_bool isl_bool(* test)(__isl_keep ISL_KEY *key, __isl_keep ISL_VAL *val, void *user)
Definition hmap.h:41
static isl_stat call_on_copy(void **entry, void *user)
Definition hmap_templ.c:339
struct isl_multi_id isl_multi_id
Definition id_type.h:16
static isl_stat flat_range_product_entry(__isl_take isl_pw_multi_aff *pma2, void *user)
Definition isl_aff.c:6520
isl_bool isl_multi_union_pw_aff_has_non_trivial_domain(__isl_keep isl_multi_union_pw_aff *mupa)
Definition isl_aff.c:8681
static isl_stat bin_entry(__isl_take isl_pw_multi_aff *pma, void *user)
Definition isl_aff.c:6407
static isl_stat reset_range_space(__isl_take isl_pw_multi_aff *pma, void *user)
Definition isl_aff.c:9205
static isl_stat reset_params(__isl_take isl_pw_aff *pa, void *user)
Definition isl_aff.c:8123
static isl_stat range_product_entry(__isl_take isl_pw_multi_aff *pma2, void *user)
Definition isl_aff.c:6540
__isl_give isl_basic_set * isl_set_combined_lineality_space(__isl_take isl_set *set)
#define isl_int_cmp(i, j)
Definition isl_int_gmp.h:55
#define isl_int_ne(i, j)
Definition isl_int_gmp.h:58
mpz_t isl_int
Definition isl_int_gmp.h:9
#define isl_int_init(i)
Definition isl_int_gmp.h:11
#define isl_int_clear(i)
Definition isl_int_gmp.h:12
__isl_give dup(__isl_keep LIST(EL) *list)
__isl_give isl_map * isl_map_reset_space(__isl_take isl_map *map, __isl_take isl_space *space)
Definition isl_map.c:6467
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition isl_map.c:73
isl_bool isl_map_has_space_tuples(__isl_keep isl_map *map, __isl_keep isl_space *space)
Definition isl_map.c:9414
__isl_give isl_map * isl_map_realign(__isl_take isl_map *map, __isl_take isl_reordering *r)
Definition isl_map.c:13100
isl_bool isl_map_space_tuple_is_equal(__isl_keep isl_map *map, enum isl_dim_type type1, __isl_keep isl_space *space, enum isl_dim_type type2)
Definition isl_map.c:9388
__isl_give isl_map * isl_map_reset_equal_dim_space(__isl_take isl_map *map, __isl_take isl_space *space)
Definition isl_map.c:6498
isl_bool isl_map_plain_is_fixed(__isl_keep isl_map *map, enum isl_dim_type type, unsigned pos, isl_int *val)
Definition isl_map.c:10809
__isl_keep isl_space * isl_map_peek_space(__isl_keep const isl_map *map)
Definition isl_map.c:101
isl_bool isl_map_space_has_equal_params(__isl_keep isl_map *map, __isl_keep isl_space *space)
Definition isl_map.c:13241
isl_bool isl_map_tuple_is_equal(__isl_keep isl_map *map1, enum isl_dim_type type1, __isl_keep isl_map *map2, enum isl_dim_type type2)
Definition isl_map.c:9401
#define isl_basic_set_list
#define isl_set_list
__isl_give isl_map * isl_map_plain_gist(__isl_take isl_map *map, __isl_take isl_map *context)
#define isl_set
#define isl_basic_set
static struct isl_arg_choice bound[]
Definition isl_options.c:39
static isl_stat foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sample)
Definition isl_point.c:568
__isl_null isl_reordering * isl_reordering_free(__isl_take isl_reordering *exp)
__isl_give isl_reordering * isl_parameter_alignment_reordering(__isl_keep isl_space *alignee, __isl_keep isl_space *aligner)
__isl_give isl_space * isl_reordering_get_space(__isl_keep isl_reordering *r)
__isl_give isl_reordering * isl_reordering_extend_space(__isl_take isl_reordering *exp, __isl_take isl_space *space)
__isl_give isl_reordering * isl_reordering_copy(__isl_keep isl_reordering *exp)
static isl_bool not(__isl_keep isl_set *set, void *user)
static isl_bool call_every(__isl_keep isl_schedule_node *node, void *user)
__isl_give isl_space * isl_space_extend_domain_with_range(__isl_take isl_space *space, __isl_take isl_space *model)
Definition isl_space.c:3382
static isl_bool match(__isl_keep isl_space *space1, enum isl_dim_type type1, __isl_keep isl_space *space2, enum isl_dim_type type2)
Definition isl_space.c:1145
__isl_give isl_space * isl_space_replace_params(__isl_take isl_space *dst, __isl_keep isl_space *src)
Definition isl_space.c:3060
isl_bool isl_space_has_domain_tuples(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition isl_space.c:2626
isl_bool isl_space_has_range_tuples(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition isl_space.c:2644
uint32_t isl_space_get_tuple_hash(__isl_keep isl_space *space)
Definition isl_space.c:2821
int sv
Definition isl_test.c:3497
enum isl_fold type
Definition isl_test.c:3810
const char * set
Definition isl_test.c:1364
const char * ma
Definition isl_test.c:7330
const char * map
Definition isl_test.c:1734
int equal
Definition isl_test.c:7663
const char * pma
Definition isl_test.c:2962
const char * name
Definition isl_test.c:10692
const char * context
Definition isl_test.c:1735
const char * map1
Definition isl_test.c:365
const char * map2
Definition isl_test.c:366
const char * set1
Definition isl_test.c:3998
const char * tuple
Definition isl_test.c:6803
const char * res
Definition isl_test.c:783
const char * set2
Definition isl_test.c:3999
const char * mupa
Definition isl_test.c:7160
const char * id
Definition isl_test.c:7074
static isl_stat foreach_point(__isl_take isl_set *set, void *user)
static isl_stat intersect_params_entry(void **entry, void *user)
static isl_bool plain_injective_on_range_wrap(__isl_keep isl_set *ran, void *user)
__isl_give isl_union_map * isl_union_set_unwrap(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_lex_ge_union_map(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_set * isl_union_map_domain(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_preimage_domain_union_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_union_pw_multi_aff *upma)
static isl_stat domain_map_upma(__isl_take isl_map *map, void *user)
static __isl_give isl_set * combined_lineality_space(__isl_take isl_set *set)
__isl_give isl_set * isl_set_from_union_set(__isl_take isl_union_set *uset)
__isl_null isl_union_map * isl_union_map_free(__isl_take isl_union_map *umap)
static isl_stat preimage_mpa_entry(void **entry, void *user)
isl_size isl_union_set_dim(__isl_keep isl_union_set *uset, enum isl_dim_type type)
__isl_give isl_space * isl_union_set_get_space(__isl_keep isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_gist_params(__isl_take isl_union_set *uset, __isl_take isl_set *set)
__isl_give isl_union_map * isl_union_map_apply_range(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_set_wrapped_domain_map(__isl_take isl_union_set *uset)
static isl_bool plain_injective_on_range(__isl_take isl_union_map *umap, int first, int n_range)
__isl_give isl_union_set * isl_union_set_subtract(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
__isl_give isl_point * isl_union_set_sample_point(__isl_take isl_union_set *uset)
static isl_stat set_product_entry(void **entry, void *user)
static __isl_give isl_union_map * bin_add_map(__isl_take isl_union_map *res, __isl_keep isl_map *map)
__isl_give isl_union_map * isl_union_map_compute_divs(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_set_lex_gt_union_set(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
__isl_give isl_union_set * isl_union_set_solutions(__isl_take isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_list_union(__isl_take isl_union_set_list *list)
__isl_give isl_basic_set * isl_union_set_sample(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_intersect_domain_space(__isl_take isl_union_map *umap, __isl_take isl_space *space)
isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2)
__isl_give isl_union_map * isl_union_set_identity(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_gist_params(__isl_take isl_union_map *umap, __isl_take isl_set *set)
__isl_give isl_union_map * isl_union_map_add_map(__isl_take isl_union_map *umap, __isl_take isl_map *map)
static __isl_give isl_union_map * gen_bin_set_op(__isl_take isl_union_map *umap, __isl_take isl_set *set, isl_stat(*fn)(void **, void *))
static __isl_give isl_map * isl_map_polyhedral_hull_map(__isl_take isl_map *map)
__isl_give isl_union_map * isl_union_map_from_domain_and_range(__isl_take isl_union_set *domain, __isl_take isl_union_set *range)
__isl_give isl_map * isl_map_from_union_map(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_intersect(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_set * isl_union_set_apply(__isl_take isl_union_set *uset, __isl_take isl_union_map *umap)
isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap, isl_stat(*fn)(__isl_take isl_map *map, void *user), void *user)
__isl_give isl_union_set * isl_union_set_reset_user(__isl_take isl_union_set *uset)
static isl_stat match_bin_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_affine_hull(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_align_params(__isl_take isl_union_map *umap, __isl_take isl_space *model)
static isl_bool test_set_from_map(__isl_keep isl_map *map, void *user)
static isl_stat check_union_map_space_equal_dim(__isl_keep isl_union_map *umap, __isl_keep isl_space *space)
static isl_bool un_op_filter_drop_user(__isl_keep isl_map *map, void *user)
static __isl_give isl_union_map * union_map_intersect_domain(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_intersect(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
__isl_give isl_union_set * isl_union_set_from_set(__isl_take isl_set *set)
__isl_keep isl_space * isl_union_set_peek_space(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_factor_range(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_domain_reverse(__isl_take isl_union_map *umap)
static __isl_give isl_map * map_id(__isl_take isl_map *map)
__isl_give isl_union_set * isl_union_map_wrap(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_product(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
static isl_bool union_map_forall(__isl_keep isl_union_map *umap, isl_bool(*fn)(__isl_keep isl_map *map))
__isl_give isl_union_set * isl_union_set_from_basic_set(__isl_take isl_basic_set *bset)
__isl_give isl_union_map * isl_union_map_from_map(__isl_take isl_map *map)
__isl_give isl_union_map * isl_union_map_from_basic_map(__isl_take isl_basic_map *bmap)
__isl_give isl_set * isl_union_set_extract_set(__isl_keep isl_union_set *uset, __isl_take isl_space *space)
static isl_stat forall_entry(void **entry, void *user)
static isl_bool map_excludes(__isl_keep isl_map *map, void *user)
__isl_give isl_union_map * isl_union_map_intersect_range_union_set(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_flat_range_product(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_set * isl_union_set_empty_ctx(isl_ctx *ctx)
isl_bool isl_union_set_is_params(__isl_keep isl_union_set *uset)
static __isl_give isl_union_map * inplace(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
isl_bool isl_union_map_plain_is_injective(__isl_keep isl_union_map *umap)
__isl_give isl_space * isl_union_map_get_space(__isl_keep isl_union_map *umap)
isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_preimage_range_union_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_union_pw_multi_aff *upma)
static __isl_give isl_union_map * isl_union_map_order_at_multi_union_pw_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_union_pw_aff *mupa, __isl_give isl_map *(*order)(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2))
__isl_give isl_union_set * isl_union_set_align_params(__isl_take isl_union_set *uset, __isl_take isl_space *model)
__isl_give isl_set * isl_union_set_as_set(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_deltas_map(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_intersect_params(__isl_take isl_union_set *uset, __isl_take isl_set *set)
__isl_give isl_union_map * isl_union_map_intersect_params(__isl_take isl_union_map *umap, __isl_take isl_set *set)
static int domain_match(__isl_keep isl_map *map, __isl_keep isl_space *space)
isl_bool isl_union_map_space_has_equal_params(__isl_keep isl_union_map *umap, __isl_keep isl_space *space)
static isl_stat range_product_entry(void **entry, void *user)
static isl_stat call_on_copy(void **entry, void *user)
__isl_give isl_set_list * isl_union_set_get_set_list(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_lex_lt_union_map(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_range_product(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_preimage_range_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma)
__isl_give isl_union_map * isl_union_map_intersect_range_factor_domain(__isl_take isl_union_map *umap, __isl_take isl_union_map *factor)
static isl_bool single_map_is_single_valued(__isl_keep isl_union_map *umap)
static __isl_keep isl_maybe_isl_map bin_try_get_match(struct isl_union_map_gen_bin_data *data, __isl_keep isl_map *map)
__isl_give isl_union_set * isl_union_set_add_set(__isl_take isl_union_set *uset, __isl_take isl_set *set)
static isl_stat sample_entry(void **entry, void *user)
static struct isl_fixed_map * alloc_isl_fixed_map_array(isl_ctx *ctx, int n)
__isl_give isl_union_map * isl_union_map_dup(__isl_keep isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_project_out(__isl_take isl_union_set *uset, enum isl_dim_type type, unsigned first, unsigned n)
__isl_give isl_union_map * isl_union_map_subtract(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_set_preimage_multi_aff(__isl_take isl_union_set *uset, __isl_take isl_multi_aff *ma)
static int qsort_fixed_map_cmp(const void *p1, const void *p2)
__isl_give isl_union_map * isl_union_map_range_map(__isl_take isl_union_map *umap)
static isl_bool has_domain_space_tuples(__isl_keep isl_map *map, void *user)
__isl_give isl_basic_map * isl_union_map_sample(__isl_take isl_union_map *umap)
static __isl_give isl_union_map * preimage_union_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_union_pw_multi_aff *upma, __isl_give isl_union_map *(*fn)(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma))
__isl_give isl_union_map * isl_union_map_simple_hull(__isl_take isl_union_map *umap)
static isl_stat project_out(__isl_take isl_map *map, void *user)
__isl_give isl_union_map * isl_union_map_copy(__isl_keep isl_union_map *umap)
static isl_bool has_range_space_tuples(__isl_keep isl_map *map, void *user)
__isl_give isl_union_map * isl_union_map_flat_domain_product(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_reverse(__isl_take isl_union_map *umap)
static isl_stat is_subset_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_zip(__isl_take isl_union_map *umap)
static struct isl_hash_table_entry * isl_union_map_find_entry(__isl_keep isl_union_map *umap, __isl_keep isl_space *space, int reserve)
__isl_give isl_union_map * isl_union_map_detect_equalities(__isl_take isl_union_map *umap)
isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_lexmin(__isl_take isl_union_map *umap)
static isl_bool has_space_tuples(const void *entry, const void *val)
__isl_give isl_union_map * isl_union_map_intersect_domain_union_set(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
static isl_stat map_lex_lt_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_lex_le_union_map(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_cow(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_plain_unshifted_simple_hull(__isl_take isl_union_set *uset)
static __isl_give isl_map * lex_le_set(__isl_take isl_map *set1, __isl_take isl_map *set2)
static isl_stat map_lex_le_entry(void **entry, void *user)
__isl_give isl_union_set * isl_set_to_union_set(__isl_take isl_set *set)
static isl_bool fixed_at_pos(__isl_keep isl_map *map, void *user)
static __isl_give isl_union_map * preimage_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma, int(*match)(__isl_keep isl_map *map, __isl_keep isl_space *space), __isl_give isl_map *(*fn)(__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma))
isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n)
__isl_give isl_union_set * isl_union_set_empty(__isl_take isl_space *space)
static isl_bool not(__isl_keep isl_map *map, void *user)
__isl_give isl_map_list * isl_union_map_get_map_list(__isl_keep isl_union_map *umap)
static isl_stat un_entry(void **entry, void *user)
isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset, isl_stat(*fn)(__isl_take isl_point *pnt, void *user), void *user)
__isl_give isl_union_map * isl_union_map_intersect_range_factor_range(__isl_take isl_union_map *umap, __isl_take isl_union_map *factor)
static __isl_give isl_union_map * total(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
static isl_stat add_map(__isl_take isl_map *map, void *user)
__isl_give isl_union_pw_multi_aff * isl_union_map_domain_map_union_pw_multi_aff(__isl_take isl_union_map *umap)
__isl_give isl_set * isl_union_set_params(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_domain_product(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_set * isl_union_set_remove_divs(__isl_take isl_union_set *uset)
static isl_stat preimage_upma(__isl_take isl_pw_multi_aff *pma, void *user)
__isl_give isl_union_map * isl_union_map_empty(__isl_take isl_space *space)
static __isl_give isl_union_map * preimage_multi_pw_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa, int(*match)(__isl_keep isl_map *map, __isl_keep isl_space *space), __isl_give isl_map *(*fn)(__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa))
__isl_give isl_union_map * isl_union_map_remove_redundancies(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_factor_domain(__isl_take isl_union_map *umap)
__isl_give isl_map * isl_union_map_extract_map(__isl_keep isl_union_map *umap, __isl_take isl_space *space)
isl_bool isl_union_set_every_set(__isl_keep isl_union_set *uset, isl_bool(*test)(__isl_keep isl_set *set, void *user), void *user)
static int separates(struct isl_fixed_map *v, int n, __isl_take isl_space *space, int pos, int n_range)
static isl_bool is_subset_of_identity(__isl_keep isl_map *map)
static int range_match(__isl_keep isl_map *map, __isl_keep isl_space *space)
__isl_give isl_union_map * isl_union_map_plain_unshifted_simple_hull(__isl_take isl_union_map *umap)
uint32_t isl_union_set_get_hash(__isl_keep isl_union_set *uset)
static isl_stat forall_user_entry(void **entry, void *user)
__isl_give isl_union_set * isl_union_set_coalesce(__isl_take isl_union_set *uset)
static isl_stat add_n(__isl_take isl_set *set, void *user)
static __isl_give isl_map * universe(__isl_take isl_map *map)
static isl_stat product_entry(void **entry, void *user)
__isl_give isl_union_set * isl_union_set_empty_space(__isl_take isl_space *space)
__isl_give isl_union_set * isl_union_set_lexmin(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_from_domain(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_intersect_domain_factor_range(__isl_take isl_union_map *umap, __isl_take isl_union_map *factor)
__isl_give isl_union_map * isl_union_map_preimage_domain_multi_pw_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa)
static isl_stat add_list(__isl_take isl_set *set, void *user)
__isl_keep isl_space * isl_union_map_peek_space(__isl_keep isl_union_map *umap)
static isl_stat is_disjoint_entry(void **entry, void *user)
static __isl_give isl_space * identity(__isl_take isl_space *space)
isl_bool isl_union_map_is_identity(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_reset_range_space(__isl_take isl_union_map *umap, __isl_take isl_space *space)
__isl_give isl_union_map * isl_union_map_range_factor_range(__isl_take isl_union_map *umap)
isl_bool isl_union_map_isa_map(__isl_keep isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_union(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
isl_bool isl_union_set_space_has_equal_params(__isl_keep isl_union_set *uset, __isl_keep isl_space *space)
static isl_stat reset_range_space(__isl_take isl_map *map, void *user)
static int set_match(__isl_keep isl_map *map, __isl_keep isl_space *space)
__isl_give isl_union_map * isl_union_map_gist_range(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
isl_size isl_union_set_n_set(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_intersect_domain(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_range_reverse(__isl_take isl_union_map *umap)
static isl_stat map_plain_is_not_identity(__isl_take isl_map *map, void *user)
static isl_stat copy_map(void **entry, void *user)
isl_bool isl_union_map_every_map(__isl_keep isl_union_map *umap, isl_bool(*test)(__isl_keep isl_map *map, void *user), void *user)
int isl_union_map_find_dim_by_name(__isl_keep isl_union_map *umap, enum isl_dim_type type, const char *name)
__isl_give isl_union_set * isl_union_set_plain_gist(__isl_take isl_union_set *uset, __isl_take isl_union_set *context)
static void free_isl_fixed_map_array(struct isl_fixed_map *v, int n)
__isl_give isl_union_set * isl_union_set_lexmax(__isl_take isl_union_set *uset)
isl_ctx * isl_union_set_get_ctx(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_intersect_domain_factor_domain(__isl_take isl_union_map *umap, __isl_take isl_union_map *factor)
__isl_give isl_union_map * isl_union_map_gist_domain(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
isl_ctx * isl_union_map_get_ctx(__isl_keep isl_union_map *umap)
static isl_stat domain_product_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_coalesce(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_preimage_union_pw_multi_aff(__isl_take isl_union_set *uset, __isl_take isl_union_pw_multi_aff *upma)
__isl_give isl_union_map * isl_union_map_curry(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_gist(__isl_take isl_union_set *uset, __isl_take isl_union_set *context)
__isl_give isl_union_map * isl_union_map_project_out(__isl_take isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n)
static static isl_size isl_union_map_dim(__isl_keep isl_union_map *umap, enum isl_dim_type type)
__isl_give isl_union_set * isl_union_map_deltas(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_map_to_union_map(__isl_take isl_map *map)
static __isl_give isl_union_map * union_map_intersect_params(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
static isl_bool union_map_forall_user(__isl_keep isl_union_map *umap, isl_bool(*fn)(__isl_keep isl_map *map, void *user), void *user)
static isl_stat solutions_entry(void **entry, void *user)
static __isl_give isl_map * lex_lt_set(__isl_take isl_map *set1, __isl_take isl_map *set2)
__isl_give isl_union_map * isl_union_map_intersect_range_wrapped_domain_union_set(__isl_take isl_union_map *umap, __isl_take isl_union_set *domain)
static __isl_give isl_map * isl_map_plain_unshifted_simple_hull_map(__isl_take isl_map *map)
isl_bool isl_union_map_is_bijective(__isl_keep isl_union_map *umap)
static isl_stat gen_bin_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_preimage_range_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma)
__isl_give isl_union_map * isl_union_map_plain_gist(__isl_take isl_union_map *umap, __isl_take isl_union_map *context)
static isl_stat apply_range_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_uncurry(__isl_take isl_union_map *umap)
static isl_stat single_valued_on_domain(__isl_take isl_set *set, void *user)
__isl_give isl_basic_set_list * isl_union_set_get_basic_set_list(__isl_keep isl_union_set *uset)
static isl_stat add_list_map(__isl_take isl_map *map, void *user)
isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset, isl_stat(*fn)(__isl_take isl_set *set, void *user), void *user)
__isl_give isl_union_map * isl_union_map_from_range(__isl_take isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_preimage_pw_multi_aff(__isl_take isl_union_set *uset, __isl_take isl_pw_multi_aff *pma)
__isl_give isl_union_map * isl_union_map_preimage_domain_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma)
__isl_give isl_union_set * isl_union_set_drop_unused_params(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_set_lex_le_union_set(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
isl_bool isl_union_set_isa_set(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_lexmax(__isl_take isl_union_map *umap)
static isl_stat reset_params(__isl_take isl_map *map, void *user)
isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2)
static __isl_give isl_map * isl_map_simple_hull_map(__isl_take isl_map *map)
__isl_give isl_union_map * isl_union_map_range_curry(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_remove_map_if(__isl_take isl_union_map *umap, isl_bool(*fn)(__isl_keep isl_map *map, void *user), void *user)
static __isl_give isl_union_map * gen_bin_op(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2, struct isl_bin_op_control *control)
__isl_give isl_union_map * isl_union_map_polyhedral_hull(__isl_take isl_union_map *umap)
isl_bool isl_union_map_is_single_valued(__isl_keep isl_union_map *umap)
static isl_stat map_is_identity(__isl_take isl_map *map, void *user)
isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2)
__isl_give isl_union_map * isl_union_map_empty_space(__isl_take isl_space *space)
__isl_give isl_map * isl_union_map_as_map(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_empty_ctx(isl_ctx *ctx)
__isl_give isl_union_set * isl_union_set_remove_redundancies(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_set_lex_lt_union_set(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
__isl_give isl_union_map * isl_union_map_reset_equal_dim_space(__isl_take isl_union_map *umap, __isl_take isl_space *space)
__isl_give isl_union_map * isl_union_set_lex_ge_union_set(__isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2)
__isl_give isl_union_set * isl_union_set_copy(__isl_keep isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_affine_hull(__isl_take isl_union_set *uset)
static isl_bool equal_tuples(__isl_keep isl_map *map, void *user)
static __isl_give isl_union_map * union_map_gist_domain(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
isl_bool isl_union_set_is_empty(__isl_keep isl_union_set *uset)
static __isl_give isl_union_map * bin_add_pair(__isl_take isl_union_map *res, __isl_keep isl_map *map1, __isl_keep isl_map *map2, struct isl_union_map_gen_bin_data *data)
isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2)
__isl_give isl_union_set * isl_union_set_combined_lineality_space(__isl_take isl_union_set *uset)
static isl_stat order_at(__isl_take isl_map *map, void *user)
static __isl_give isl_map * isl_map_affine_hull_map(__isl_take isl_map *map)
static isl_stat preimage_entry(void **entry, void *user)
static isl_stat coefficients_entry(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_intersect_range_space(__isl_take isl_union_map *umap, __isl_take isl_space *space)
__isl_give isl_union_map * isl_union_map_domain_factor_range(__isl_take isl_union_map *umap)
static isl_stat free_umap_entry(void **entry, void *user)
static isl_stat align_entry(void **entry, void *user)
static isl_stat identity_upma(__isl_take isl_set *set, void *user)
__isl_give isl_union_set * isl_union_map_range(__isl_take isl_union_map *umap)
isl_bool isl_union_map_is_injective(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_preimage_domain_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma)
static __isl_give isl_union_map * isl_union_map_drop_dims(__isl_take isl_union_map *umap, enum isl_dim_type type, unsigned first, unsigned n)
__isl_give isl_set * isl_union_map_params(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_product(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
isl_size isl_union_map_n_map(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_range_factor_domain(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_lex_gt_union_map(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
__isl_give isl_union_map * isl_union_map_gist(__isl_take isl_union_map *umap, __isl_take isl_union_map *context)
__isl_give isl_union_map * isl_union_map_domain_factor_domain(__isl_take isl_union_map *umap)
static isl_stat flat_domain_product_entry(void **entry, void *user)
__isl_give isl_union_set * isl_union_set_detect_equalities(__isl_take isl_union_set *uset)
static isl_stat bin_entry(void **entry, void *user)
isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1, __isl_keep isl_union_map *umap2)
isl_bool isl_union_map_contains(__isl_keep isl_union_map *umap, __isl_keep isl_space *space)
__isl_give isl_union_map * isl_union_map_union(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
struct isl_hash_table_entry * isl_union_set_find_entry(__isl_keep isl_union_set *uset, __isl_keep isl_space *space, int reserve)
isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2)
uint32_t isl_union_map_get_hash(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_apply_domain(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2)
isl_bool isl_union_map_is_params(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_eq_at_multi_union_pw_aff(__isl_take isl_union_map *umap, __isl_take isl_multi_union_pw_aff *mupa)
__isl_null isl_union_set * isl_union_set_free(__isl_take isl_union_set *uset)
__isl_give isl_id * isl_union_map_get_dim_id(__isl_keep isl_union_map *umap, enum isl_dim_type type, unsigned pos)
__isl_give isl_union_set * isl_union_set_lift(__isl_take isl_union_set *uset)
static __isl_give isl_union_map * match_bin_op(__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2, __isl_give isl_map *(*fn)(__isl_take isl_map *, __isl_take isl_map *))
int isl_union_set_n_basic_set(__isl_keep isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_universe(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_remove_divs(__isl_take isl_union_map *umap)
__isl_give isl_union_set * isl_union_set_simple_hull(__isl_take isl_union_set *uset)
static __isl_give isl_union_map * isl_union_map_alloc(__isl_take isl_space *space, int size)
static isl_stat flat_range_product_entry(void **entry, void *user)
__isl_give isl_union_set * isl_union_set_compute_divs(__isl_take isl_union_set *uset)
isl_bool isl_union_set_contains(__isl_keep isl_union_set *uset, __isl_keep isl_space *space)
static isl_stat add_hash(__isl_take isl_map *map, void *user)
__isl_give isl_union_set * isl_union_set_universe(__isl_take isl_union_set *uset)
__isl_give isl_union_map * isl_union_map_subtract_domain(__isl_take isl_union_map *umap, __isl_take isl_union_set *dom)
__isl_give isl_union_set * isl_union_set_coefficients(__isl_take isl_union_set *uset)
static __isl_give isl_union_map * intersect_explicit_domain(__isl_take isl_union_map *umap, __isl_keep isl_multi_union_pw_aff *mupa)
static isl_bool isl_union_map_plain_is_not_identity(__isl_keep isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_domain_map(__isl_take isl_union_map *umap)
__isl_give isl_union_map * isl_union_map_reset_user(__isl_take isl_union_map *umap)
static isl_stat call_every(void **entry, void *user)
__isl_give isl_union_map * isl_union_map_intersect_domain_wrapped_domain_union_set(__isl_take isl_union_map *umap, __isl_take isl_union_set *domain)
isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1, __isl_keep isl_union_set *uset2)
__isl_give isl_union_set * isl_union_set_project_out_all_params(__isl_take isl_union_set *uset)
__isl_give isl_union_set * isl_union_set_polyhedral_hull(__isl_take isl_union_set *uset)
__isl_give isl_union_set * isl_union_map_bind_range(__isl_take isl_union_map *umap, __isl_take isl_multi_id *tuple)
static __isl_give isl_union_map * union_map_gist_params(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
static int isl_union_map_find_dim_by_id(__isl_keep isl_union_map *umap, enum isl_dim_type type, __isl_keep isl_id *id)
__isl_give isl_union_map * isl_union_map_subtract_range(__isl_take isl_union_map *umap, __isl_take isl_union_set *dom)
__isl_give isl_union_map * isl_union_map_intersect_range(__isl_take isl_union_map *umap, __isl_take isl_union_set *uset)
__isl_give isl_union_pw_multi_aff * isl_union_set_identity_union_pw_multi_aff(__isl_take isl_union_set *uset)
static isl_stat gist_params_entry(void **entry, void *user)
isl_bool isl_union_map_plain_is_empty(__isl_keep isl_union_map *umap)
#define isl_union_set_list
#define isl_union_set
__isl_give isl_map * isl_map_flat_domain_product(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:11827
__isl_give isl_basic_map * isl_map_plain_unshifted_simple_hull(__isl_take isl_map *map)
__isl_export __isl_give isl_map * isl_map_detect_equalities(__isl_take isl_map *map)
__isl_export __isl_give isl_map * isl_map_domain_product(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:11649
__isl_export __isl_give isl_map * isl_map_intersect_range(__isl_take isl_map *map, __isl_take isl_set *set)
Definition isl_map.c:8973
isl_bool isl_map_is_identity(__isl_keep isl_map *map)
Definition isl_map.c:12706
__isl_export __isl_give isl_set * isl_map_domain(__isl_take isl_map *bmap)
Definition isl_map.c:8777
__isl_export __isl_give isl_map * isl_map_union(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:8894
__isl_give isl_map * isl_map_subtract_range(__isl_take isl_map *map, __isl_take isl_set *dom)
__isl_export isl_bool isl_map_is_single_valued(__isl_keep isl_map *map)
Definition isl_map.c:12632
isl_bool isl_map_involves_dims(__isl_keep isl_map *map, enum isl_dim_type type, unsigned first, unsigned n)
Definition isl_map.c:3504
__isl_export __isl_give isl_map * isl_map_range_factor_range(__isl_take isl_map *map)
Definition isl_map.c:11802
__isl_export __isl_give isl_map * isl_map_subtract(__isl_take isl_map *map1, __isl_take isl_map *map2)
__isl_export __isl_give isl_map * isl_map_range_reverse(__isl_take isl_map *map)
Definition isl_map.c:7817
__isl_export __isl_give isl_map * isl_map_intersect_params(__isl_take isl_map *map, __isl_take isl_set *params)
Definition isl_map.c:4531
__isl_export __isl_give isl_map * isl_map_intersect(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:4514
__isl_export isl_bool isl_map_is_empty(__isl_keep isl_map *map)
Definition isl_map.c:9801
__isl_export __isl_give isl_map * isl_map_universe(__isl_take isl_space *space)
Definition isl_map.c:6967
__isl_export __isl_give isl_map * isl_map_zip(__isl_take isl_map *map)
Definition isl_map.c:13752
__isl_export __isl_give isl_map * isl_map_gist(__isl_take isl_map *map, __isl_take isl_map *context)
__isl_export __isl_give isl_map * isl_map_apply_range(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:9277
__isl_export __isl_give isl_basic_map * isl_map_sample(__isl_take isl_map *map)
isl_bool isl_basic_map_plain_is_empty(__isl_keep isl_basic_map *bmap)
Definition isl_map.c:10089
__isl_export __isl_give isl_map * isl_map_factor_domain(__isl_take isl_map *map)
Definition isl_map.c:11669
__isl_overload __isl_give isl_map * isl_map_preimage_domain_pw_multi_aff(__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma)
Definition isl_map.c:14814
__isl_give isl_map * isl_map_copy(__isl_keep isl_map *map)
Definition isl_map.c:1494
__isl_export __isl_give isl_map * isl_set_identity(__isl_take isl_set *set)
Definition isl_map.c:9563
__isl_export __isl_give isl_map * isl_map_domain_factor_domain(__isl_take isl_map *map)
Definition isl_map.c:11727
__isl_export __isl_give isl_map * isl_map_intersect_range_factor_domain(__isl_take isl_map *map, __isl_take isl_map *factor)
Definition isl_map.c:9141
__isl_export __isl_give isl_space * isl_map_get_space(__isl_keep isl_map *map)
Definition isl_map.c:599
__isl_export __isl_give isl_map * isl_map_intersect_domain_wrapped_domain(__isl_take isl_map *map, __isl_take isl_set *domain)
__isl_export __isl_give isl_map * isl_map_uncurry(__isl_take isl_map *map)
Definition isl_map.c:13893
__isl_export __isl_give isl_map * isl_map_intersect_domain(__isl_take isl_map *map, __isl_take isl_set *set)
Definition isl_map.c:9001
__isl_give isl_map * isl_map_lex_le_map(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:6065
isl_bool isl_map_plain_is_injective(__isl_keep isl_map *map)
Definition isl_map.c:12671
isl_bool isl_map_can_zip(__isl_keep isl_map *map)
Definition isl_map.c:13705
isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map)
Definition isl_map.c:12843
__isl_export isl_bool isl_set_is_wrapping(__isl_keep isl_set *set)
Definition isl_map.c:12804
isl_bool isl_map_can_range_curry(__isl_keep isl_map *map)
Definition isl_map.c:13827
__isl_export __isl_give isl_set * isl_map_deltas(__isl_take isl_map *map)
Definition isl_map.c:9442
__isl_export __isl_give isl_map * isl_map_lexmin(__isl_take isl_map *map)
__isl_overload __isl_give isl_map * isl_map_preimage_domain_multi_pw_aff(__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa)
Definition isl_map.c:14886
isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map)
Definition isl_map.c:9818
isl_bool isl_map_can_uncurry(__isl_keep isl_map *map)
Definition isl_map.c:13859
__isl_give isl_map * isl_map_range_map(__isl_take isl_map *map)
Definition isl_map.c:6777
__isl_export __isl_give isl_map * isl_map_intersect_domain_factor_domain(__isl_take isl_map *map, __isl_take isl_map *factor)
Definition isl_map.c:9111
__isl_export __isl_give isl_map * isl_map_intersect_domain_factor_range(__isl_take isl_map *map, __isl_take isl_map *factor)
Definition isl_map.c:9126
uint32_t isl_map_get_hash(__isl_keep isl_map *map)
Definition isl_map.c:11892
__isl_export __isl_give isl_map * isl_map_empty(__isl_take isl_space *space)
Definition isl_map.c:6957
__isl_export __isl_give isl_map * isl_set_unwrap(__isl_take isl_set *set)
Definition isl_map.c:12909
__isl_give isl_map * isl_map_flat_range_product(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:11839
__isl_export __isl_give isl_basic_map * isl_map_affine_hull(__isl_take isl_map *map)
isl_bool isl_map_can_curry(__isl_keep isl_map *map)
Definition isl_map.c:13781
__isl_export __isl_give isl_set * isl_map_wrap(__isl_take isl_map *map)
Definition isl_map.c:12883
__isl_export __isl_give isl_map * isl_map_factor_range(__isl_take isl_map *map)
Definition isl_map.c:11698
__isl_export __isl_give isl_map * isl_map_curry(__isl_take isl_map *map)
Definition isl_map.c:13817
__isl_give isl_map * isl_map_align_params(__isl_take isl_map *map, __isl_take isl_space *model)
Definition isl_map.c:13143
__isl_export __isl_give isl_map * isl_map_domain_factor_range(__isl_take isl_map *map)
Definition isl_map.c:11752
__isl_give isl_map * isl_map_reset_user(__isl_take isl_map *map)
Definition isl_map.c:1117
__isl_export __isl_give isl_map * isl_map_lexmax(__isl_take isl_map *map)
__isl_export __isl_give isl_map * isl_map_intersect_range_wrapped_domain(__isl_take isl_map *map, __isl_take isl_set *domain)
Definition isl_map.c:9247
__isl_export __isl_give isl_map * isl_map_reverse(__isl_take isl_map *map)
Definition isl_map.c:7801
__isl_give isl_map * isl_map_deltas_map(__isl_take isl_map *map)
Definition isl_map.c:9517
__isl_export __isl_give isl_map * isl_map_gist_params(__isl_take isl_map *map, __isl_take isl_set *context)
__isl_give isl_map * isl_map_subtract_domain(__isl_take isl_map *map, __isl_take isl_set *dom)
__isl_export __isl_give isl_map * isl_map_range_product(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:11659
__isl_give isl_map * isl_map_from_range(__isl_take isl_set *set)
Definition isl_map.c:6823
__isl_give isl_map * isl_map_domain_map(__isl_take isl_map *map)
Definition isl_map.c:6771
__isl_export __isl_give isl_map * isl_map_domain_reverse(__isl_take isl_map *map)
Definition isl_map.c:7809
__isl_give isl_map * isl_map_gist_range(__isl_take isl_map *map, __isl_take isl_set *context)
__isl_export __isl_give isl_map * isl_map_product(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:11613
__isl_give isl_map * isl_map_remove_divs(__isl_take isl_map *map)
Definition isl_map.c:2784
__isl_export isl_bool isl_map_is_disjoint(__isl_keep isl_map *map1, __isl_keep isl_map *map2)
__isl_give isl_map * isl_map_remove_redundancies(__isl_take isl_map *map)
__isl_export __isl_give isl_map * isl_map_range_factor_domain(__isl_take isl_map *map)
Definition isl_map.c:11777
__isl_give isl_map * isl_map_range_curry(__isl_take isl_map *map)
Definition isl_map.c:13838
isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map)
Definition isl_map.c:12860
__isl_overload __isl_give isl_map * isl_map_preimage_range_pw_multi_aff(__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma)
Definition isl_map.c:14826
__isl_give isl_basic_map * isl_basic_map_empty(__isl_take isl_space *space)
Definition isl_map.c:6886
__isl_export __isl_give isl_map * isl_map_coalesce(__isl_take isl_map *map)
__isl_give isl_map * isl_map_identity(__isl_take isl_space *space)
Definition isl_map.c:9558
__isl_give isl_map * isl_set_wrapped_domain_map(__isl_take isl_set *set)
Definition isl_map.c:6786
__isl_export __isl_give isl_set * isl_map_params(__isl_take isl_map *map)
Definition isl_map.c:6585
__isl_null isl_map * isl_map_free(__isl_take isl_map *map)
Definition isl_map.c:7040
__isl_export __isl_give isl_map * isl_map_gist_domain(__isl_take isl_map *map, __isl_take isl_set *context)
__isl_constructor __isl_give isl_map * isl_map_from_basic_map(__isl_take isl_basic_map *bmap)
Definition isl_map.c:4037
__isl_give isl_map * isl_map_project_out(__isl_take isl_map *map, enum isl_dim_type type, unsigned first, unsigned n)
Definition isl_map.c:5181
__isl_give isl_map * isl_map_lex_lt_map(__isl_take isl_map *map1, __isl_take isl_map *map2)
Definition isl_map.c:6075
__isl_export __isl_give isl_map * isl_map_intersect_range_factor_range(__isl_take isl_map *map, __isl_take isl_map *factor)
Definition isl_map.c:9156
__isl_export __isl_give isl_basic_map * isl_map_polyhedral_hull(__isl_take isl_map *map)
__isl_give isl_map * isl_map_compute_divs(__isl_take isl_map *map)
Definition isl_map.c:8734
__isl_give isl_basic_map * isl_map_simple_hull(__isl_take isl_map *map)
__isl_export __isl_give isl_set * isl_map_bind_range(__isl_take isl_map *map, __isl_take isl_multi_id *tuple)
Definition isl_map.c:13419
__isl_export __isl_give isl_set * isl_map_range(__isl_take isl_map *map)
Definition isl_map.c:6728
__isl_export isl_bool isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2)
isl_bool isl_map_is_product(__isl_keep isl_map *map)
Definition isl_map.c:12853
struct isl_map isl_map
Definition map_type.h:15
__isl_give isl_map * isl_set_lex_lt_set(__isl_take isl_set *set1, __isl_take isl_set *set2)
Definition isl_map.c:6035
__isl_give isl_map * isl_set_lex_le_set(__isl_take isl_set *set1, __isl_take isl_set *set2)
Definition isl_map.c:6025
__isl_export __isl_give isl_set * isl_set_product(__isl_take isl_set *set1, __isl_take isl_set *set2)
Definition isl_map.c:11635
__isl_give isl_set * isl_set_lift(__isl_take isl_set *set)
Definition isl_map.c:12035
__isl_export __isl_give isl_space * isl_set_get_space(__isl_keep isl_set *set)
Definition isl_map.c:604
__isl_null isl_set * isl_set_free(__isl_take isl_set *set)
Definition isl_map.c:4055
__isl_overload __isl_give isl_set * isl_set_preimage_pw_multi_aff(__isl_take isl_set *set, __isl_take isl_pw_multi_aff *pma)
Definition isl_map.c:14802
__isl_give isl_set * isl_set_copy(__isl_keep isl_set *set)
Definition isl_map.c:1470
__isl_give isl_basic_set_list * isl_set_get_basic_set_list(__isl_keep isl_set *set)
Definition isl_map.c:11987
__isl_export isl_stat isl_set_foreach_point(__isl_keep isl_set *set, isl_stat(*fn)(__isl_take isl_point *pnt, void *user), void *user)
Definition isl_point.c:579
isl_bool isl_set_is_params(__isl_keep isl_set *set)
Definition isl_map.c:1270
__isl_give isl_basic_set * isl_set_coefficients(__isl_take isl_set *set)
Definition isl_farkas.c:892
isl_size isl_set_dim(__isl_keep isl_set *set, enum isl_dim_type type)
Definition isl_map.c:132
__isl_give isl_set * isl_set_align_params(__isl_take isl_set *set, __isl_take isl_space *model)
Definition isl_map.c:13178
isl_bool isl_set_plain_is_universe(__isl_keep isl_set *set)
Definition isl_map.c:10039
__isl_export isl_size isl_set_n_basic_set(__isl_keep isl_set *set)
Definition isl_map.c:11928
__isl_export __isl_give isl_set * isl_set_empty(__isl_take isl_space *space)
Definition isl_map.c:6962
__isl_constructor __isl_give isl_set * isl_set_from_basic_set(__isl_take isl_basic_set *bset)
Definition isl_map.c:4024
__isl_export __isl_give isl_point * isl_basic_set_sample_point(__isl_take isl_basic_set *bset)
__isl_give isl_basic_set * isl_set_solutions(__isl_take isl_set *set)
Definition isl_farkas.c:941
static __isl_give isl_set * set_from_map(__isl_take isl_map *map)
Definition set_from_map.c:5
static __isl_give isl_set_list * set_list_from_map_list(__isl_take isl_map_list *list)
isl_bool isl_space_has_equal_params(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition isl_space.c:1173
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
Definition isl_space.c:478
__isl_give isl_space * isl_space_range_factor_range(__isl_take isl_space *space)
Definition isl_space.c:1859
__isl_give isl_space * isl_space_domain_wrapped_domain(__isl_take isl_space *space)
Definition isl_space.c:1897
__isl_export __isl_give isl_space * isl_space_params(__isl_take isl_space *space)
Definition isl_space.c:2305
__isl_give isl_space * isl_space_copy(__isl_keep isl_space *space)
Definition isl_space.c:469
__isl_give isl_space * isl_space_align_params(__isl_take isl_space *space1, __isl_take isl_space *space2)
Definition isl_space.c:3358
__isl_export __isl_give isl_space * isl_space_unit(isl_ctx *ctx)
Definition isl_space.c:237
__isl_give isl_space * isl_space_domain_factor_domain(__isl_take isl_space *space)
Definition isl_space.c:1675
__isl_give isl_space * isl_space_range_wrapped_domain(__isl_take isl_space *space)
Definition isl_space.c:1913
__isl_export __isl_give isl_space * isl_space_range(__isl_take isl_space *space)
Definition isl_space.c:2257
__isl_give isl_space * isl_space_set_alloc(isl_ctx *ctx, unsigned nparam, unsigned dim)
Definition isl_space.c:188
__isl_export __isl_give isl_space * isl_space_map_from_set(__isl_take isl_space *space)
Definition isl_space.c:1927
int isl_space_find_dim_by_id(__isl_keep isl_space *space, enum isl_dim_type type, __isl_keep isl_id *id)
Definition isl_space.c:903
__isl_export isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition isl_space.c:2605
__isl_give isl_space * isl_space_range_factor_domain(__isl_take isl_space *space)
Definition isl_space.c:1784
__isl_give isl_space * isl_space_drop_dims(__isl_take isl_space *space, enum isl_dim_type type, unsigned first, unsigned num)
Definition isl_space.c:2141
__isl_give isl_id * isl_space_get_dim_id(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos)
Definition isl_space.c:807
isl_size isl_space_dim(__isl_keep isl_space *space, enum isl_dim_type type)
Definition isl_space.c:372
__isl_export __isl_give isl_space * isl_space_drop_all_params(__isl_take isl_space *space)
Definition isl_space.c:2222
__isl_give isl_space * isl_space_domain_factor_range(__isl_take isl_space *space)
Definition isl_space.c:1711
__isl_give isl_space * isl_space_reset_user(__isl_take isl_space *space)
Definition isl_space.c:946
int isl_space_find_dim_by_name(__isl_keep isl_space *space, enum isl_dim_type type, const char *name)
Definition isl_space.c:922
__isl_give isl_space * isl_space_params_alloc(isl_ctx *ctx, unsigned nparam)
Definition isl_space.c:227
__isl_export __isl_give isl_space * isl_space_domain(__isl_take isl_space *space)
Definition isl_space.c:2232
isl_dim_type
Definition space_type.h:13
@ isl_dim_param
Definition space_type.h:15
@ isl_dim_in
Definition space_type.h:16
@ isl_dim_set
Definition space_type.h:18
@ isl_dim_out
Definition space_type.h:17
isl_bool(* filter)(__isl_keep isl_map *map)
__isl_give isl_map *(* fn_map)(__isl_take isl_map *map1, __isl_take isl_map *map2)
struct isl_fixed_map * v
isl_bool(* fn)(__isl_keep isl_map *map)
isl_bool(* fn)(__isl_keep isl_map *map, void *user)
Definition hash.h:45
uint32_t hash
Definition hash.h:46
void * data
Definition hash.h:47
struct isl_ctx * ctx
isl_bool(* test)(__isl_keep isl_set *set, void *user)
__isl_give isl_map *(* fn_map2)(__isl_take isl_map *map, void *user)
isl_bool(* filter)(__isl_keep isl_map *map, void *user)
__isl_give isl_map *(* fn_map)(__isl_take isl_map *map)
isl_bool(* filter)(__isl_keep isl_map *map)
isl_reordering * exp
isl_union_map * res
isl_stat(* fn)(void **entry, void *user)
isl_bool(* test)(__isl_keep isl_schedule_node *node, void *user)
isl_stat(* fn)(__isl_take isl_map *map, void *user)
struct isl_bin_op_control * control
int(* match)(__isl_keep isl_map *map, __isl_keep isl_space *space)
__isl_give isl_map *(* fn)(__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma)
int(* match)(__isl_keep isl_map *map, __isl_keep isl_space *space)
__isl_give isl_map *(* fn)(__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa)
__isl_give isl_union_map *(* fn)(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma)
isl_bool(* fn)(__isl_keep isl_map *map, void *user)
struct isl_un_op_control * control
struct isl_hash_table table
isl_multi_union_pw_aff * mupa
__isl_give isl_map *(* order)(__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2)
isl_stat(* fn)(__isl_take isl_point *pnt, void *user)
static Kind params
static std::vector< Signature > bin_op
static Signature range
static std::vector< Signature > un_op
static Signature set_to_map
static Signature bind_range
static Signature domain
__isl_overload __isl_give isl_union_map * isl_union_map_preimage_domain_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma)
__isl_overload __isl_give isl_union_map * isl_union_map_preimage_range_pw_multi_aff(__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma)
__isl_export __isl_give isl_union_map * isl_union_map_drop_unused_params(__isl_take isl_union_map *umap)
__isl_export __isl_give isl_union_map * isl_union_map_project_out_all_params(__isl_take isl_union_map *umap)
__isl_overload __isl_give isl_union_set * isl_union_set_preimage_pw_multi_aff(__isl_take isl_union_set *uset, __isl_take isl_pw_multi_aff *pma)
static __isl_give isl_union_set * uset_from_umap(__isl_take isl_union_map *umap)
static __isl_give isl_union_map * uset_to_umap(__isl_take isl_union_set *uset)
Definition uset_to_umap.c:7
n
Definition youcefn.c:8