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
2203{
2204 struct isl_un_op_control control = {
2205 .inplace = 1,
2206 .fn_map = fn,
2207 };
2208
2209 return un_op(umap, &control);
2210}
2211
2212/* Remove redundant constraints in each of the basic maps of "umap".
2213 * Since removing redundant constraints does not change the meaning
2214 * or the space, the operation can be performed in-place.
2215 */
2221
2222/* Remove redundant constraints in each of the basic sets of "uset".
2223 */
2229
2235
2241
2247
2253
2259
2265
2271
2277
2283
2289
2290/* Return the universe in the space of "map".
2291 */
2293{
2294 isl_space *space;
2295
2296 space = isl_map_get_space(map);
2298 return isl_map_universe(space);
2299}
2300
2302{
2303 struct isl_un_op_control control = {
2304 .fn_map = &universe,
2305 };
2306 return un_op(umap, &control);
2307}
2308
2313
2315{
2316 struct isl_un_op_control control = {
2317 .fn_map = &isl_map_reverse,
2318 };
2319 return un_op(umap, &control);
2320}
2321
2322/* Given a union map, take the maps of the form (A -> B) -> C and
2323 * return the union of the corresponding maps (B -> A) -> C.
2324 */
2327{
2329 struct isl_un_op_control control = {
2330 .filter = &un_op_filter_drop_user,
2331 .filter_user = &data,
2332 .fn_map = &isl_map_domain_reverse,
2333 };
2334 return un_op(umap, &control);
2335}
2336
2337/* Given a union map, take the maps of the form A -> (B -> C) and
2338 * return the union of the corresponding maps A -> (C -> B).
2339 */
2342{
2344 struct isl_un_op_control control = {
2345 .filter = &un_op_filter_drop_user,
2346 .filter_user = &data,
2347 .fn_map = &isl_map_range_reverse,
2348 };
2349 return un_op(umap, &control);
2350}
2351
2352/* Compute the parameter domain of the given union map.
2353 */
2355{
2356 struct isl_un_op_control control = {
2357 .fn_map = &isl_map_params,
2358 };
2359 int empty;
2360
2361 empty = isl_union_map_is_empty(umap);
2362 if (empty < 0)
2363 goto error;
2364 if (empty) {
2365 isl_space *space;
2366 space = isl_union_map_get_space(umap);
2367 isl_union_map_free(umap);
2368 return isl_set_empty(space);
2369 }
2370 return isl_set_from_union_set(un_op(umap, &control));
2371error:
2372 isl_union_map_free(umap);
2373 return NULL;
2374}
2375
2376/* Compute the parameter domain of the given union set.
2377 */
2382
2384{
2385 struct isl_un_op_control control = {
2386 .fn_map = &isl_map_domain,
2387 };
2388 return un_op(umap, &control);
2389}
2390
2392{
2393 struct isl_un_op_control control = {
2394 .fn_map = &isl_map_range,
2395 };
2396 return un_op(umap, &control);
2397}
2398
2401{
2402 struct isl_un_op_control control = {
2403 .fn_map = &isl_map_domain_map,
2404 };
2405 return un_op(umap, &control);
2406}
2407
2408/* Construct an isl_pw_multi_aff that maps "map" to its domain and
2409 * add the result to "res".
2410 */
2424
2425/* Return an isl_union_pw_multi_aff that maps a wrapped copy of "umap"
2426 * to its domain.
2427 */
2440
2443{
2444 struct isl_un_op_control control = {
2445 .fn_map = &isl_map_range_map,
2446 };
2447 return un_op(umap, &control);
2448}
2449
2450/* Given a collection of wrapped maps of the form A[B -> C],
2451 * return the collection of maps A[B -> C] -> B.
2452 */
2455{
2457 struct isl_un_op_control control = {
2458 .filter = &un_op_filter_drop_user,
2459 .filter_user = &data,
2460 .fn_map = &isl_set_wrapped_domain_map,
2461 };
2462 return un_op(uset, &control);
2463}
2464
2465/* Does "map" relate elements from the same space?
2466 */
2471
2473{
2474 struct isl_un_op_control control = {
2475 .filter = &equal_tuples,
2476 .fn_map = &isl_map_deltas,
2477 };
2478 return un_op(umap, &control);
2479}
2480
2483{
2484 struct isl_un_op_control control = {
2485 .filter = &equal_tuples,
2486 .fn_map = &isl_map_deltas_map,
2487 };
2488 return un_op(umap, &control);
2489}
2490
2492{
2493 struct isl_un_op_control control = {
2494 .fn_map = &isl_set_identity,
2495 };
2496 return un_op(uset, &control);
2497}
2498
2499/* Construct an identity isl_pw_multi_aff on "set" and add it to *res.
2500 */
2514
2515/* Return an identity function on "uset" in the form
2516 * of an isl_union_pw_multi_aff.
2517 */
2530
2531/* For each map in "umap" of the form [A -> B] -> C,
2532 * construct the map A -> C and collect the results.
2533 */
2536{
2538 struct isl_un_op_control control = {
2539 .filter = &un_op_filter_drop_user,
2540 .filter_user = &data,
2542 };
2543 return un_op(umap, &control);
2544}
2545
2546/* For each map in "umap" of the form [A -> B] -> C,
2547 * construct the map B -> C and collect the results.
2548 */
2551{
2553 struct isl_un_op_control control = {
2554 .filter = &un_op_filter_drop_user,
2555 .filter_user = &data,
2556 .fn_map = &isl_map_domain_factor_range,
2557 };
2558 return un_op(umap, &control);
2559}
2560
2561/* For each map in "umap" of the form A -> [B -> C],
2562 * construct the map A -> B and collect the results.
2563 */
2566{
2568 struct isl_un_op_control control = {
2569 .filter = &un_op_filter_drop_user,
2570 .filter_user = &data,
2571 .fn_map = &isl_map_range_factor_domain,
2572 };
2573 return un_op(umap, &control);
2574}
2575
2576/* For each map in "umap" of the form A -> [B -> C],
2577 * construct the map A -> C and collect the results.
2578 */
2581{
2583 struct isl_un_op_control control = {
2584 .filter = &un_op_filter_drop_user,
2585 .filter_user = &data,
2586 .fn_map = &isl_map_range_factor_range,
2587 };
2588 return un_op(umap, &control);
2589}
2590
2591/* For each map in "umap" of the form [A -> B] -> [C -> D],
2592 * construct the map A -> C and collect the results.
2593 */
2596{
2598 struct isl_un_op_control control = {
2599 .filter = &un_op_filter_drop_user,
2600 .filter_user = &data,
2601 .fn_map = &isl_map_factor_domain,
2602 };
2603 return un_op(umap, &control);
2604}
2605
2606/* For each map in "umap" of the form [A -> B] -> [C -> D],
2607 * construct the map B -> D and collect the results.
2608 */
2611{
2613 struct isl_un_op_control control = {
2614 .filter = &un_op_filter_drop_user,
2615 .filter_user = &data,
2616 .fn_map = &isl_map_factor_range,
2617 };
2618 return un_op(umap, &control);
2619}
2620
2622{
2624 struct isl_un_op_control control = {
2625 .filter = &un_op_filter_drop_user,
2626 .filter_user = &data,
2627 .fn_map = &isl_set_unwrap,
2628 };
2629 return un_op(uset, &control);
2630}
2631
2633{
2634 struct isl_un_op_control control = {
2635 .fn_map = &isl_map_wrap,
2636 };
2637 return un_op(umap, &control);
2638}
2639
2644
2645static isl_stat is_subset_entry(void **entry, void *user)
2646{
2647 struct isl_union_map_is_subset_data *data = user;
2648 struct isl_hash_table_entry *entry2;
2649 isl_space *space;
2650 isl_map *map = *entry;
2651
2652 space = isl_map_peek_space(map);
2653 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
2654 if (!entry2)
2655 return isl_stat_error;
2656 if (entry2 == isl_hash_table_entry_none) {
2657 int empty = isl_map_is_empty(map);
2658 if (empty < 0)
2659 return isl_stat_error;
2660 if (empty)
2661 return isl_stat_ok;
2662 data->is_subset = isl_bool_false;
2663 return isl_stat_error;
2664 }
2665
2666 data->is_subset = isl_map_is_subset(map, entry2->data);
2667 if (data->is_subset < 0 || !data->is_subset)
2668 return isl_stat_error;
2669
2670 return isl_stat_ok;
2671}
2672
2675{
2676 struct isl_union_map_is_subset_data data = { NULL, isl_bool_true };
2677
2678 if (!umap1 || !umap2)
2679 return isl_bool_error;
2680
2681 data.umap2 = umap2;
2682 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
2683 &is_subset_entry, &data) < 0 &&
2684 data.is_subset)
2685 return isl_bool_error;
2686
2687 return data.is_subset;
2688}
2689
2695
2698{
2700
2701 if (!umap1 || !umap2)
2702 return isl_bool_error;
2704 if (is_subset != isl_bool_true)
2705 return is_subset;
2707 return is_subset;
2708}
2709
2715
2729
2735
2736/* Internal data structure for isl_union_map_is_disjoint.
2737 * umap2 is the union map with which we are comparing.
2738 * is_disjoint is initialized to 1 and is set to 0 as soon
2739 * as the union maps turn out not to be disjoint.
2740 */
2745
2746/* Check if "map" is disjoint from data->umap2 and abort
2747 * the search if it is not.
2748 */
2749static isl_stat is_disjoint_entry(void **entry, void *user)
2750{
2751 struct isl_union_map_is_disjoint_data *data = user;
2752 struct isl_hash_table_entry *entry2;
2753 isl_space *space;
2754 isl_map *map = *entry;
2755
2756 space = isl_map_peek_space(map);
2757 entry2 = isl_union_map_find_entry(data->umap2, space, 0);
2758 if (!entry2)
2759 return isl_stat_error;
2760 if (entry2 == isl_hash_table_entry_none)
2761 return isl_stat_ok;
2762
2763 data->is_disjoint = isl_map_is_disjoint(map, entry2->data);
2764 if (data->is_disjoint < 0 || !data->is_disjoint)
2765 return isl_stat_error;
2766
2767 return isl_stat_ok;
2768}
2769
2770/* Are "umap1" and "umap2" disjoint?
2771 */
2774{
2775 struct isl_union_map_is_disjoint_data data = { NULL, isl_bool_true };
2776
2777 umap1 = isl_union_map_copy(umap1);
2779 umap1 = isl_union_map_align_params(umap1,
2783
2784 if (!umap1 || !umap2)
2785 goto error;
2786
2787 data.umap2 = umap2;
2788 if (isl_hash_table_foreach(umap1->dim->ctx, &umap1->table,
2789 &is_disjoint_entry, &data) < 0 &&
2790 data.is_disjoint)
2791 goto error;
2792
2793 isl_union_map_free(umap1);
2795
2796 return data.is_disjoint;
2797error:
2798 isl_union_map_free(umap1);
2800 return isl_bool_error;
2801}
2802
2803/* Are "uset1" and "uset2" disjoint?
2804 */
2810
2811static isl_stat sample_entry(void **entry, void *user)
2812{
2813 isl_basic_map **sample = (isl_basic_map **)user;
2814 isl_map *map = *entry;
2815
2816 *sample = isl_map_sample(isl_map_copy(map));
2817 if (!*sample)
2818 return isl_stat_error;
2819 if (!isl_basic_map_plain_is_empty(*sample))
2820 return isl_stat_error;
2821 return isl_stat_ok;
2822}
2823
2825{
2826 isl_basic_map *sample = NULL;
2827
2828 if (!umap)
2829 return NULL;
2830
2831 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2832 &sample_entry, &sample) < 0 &&
2833 !sample)
2834 goto error;
2835
2836 if (!sample)
2838
2839 isl_union_map_free(umap);
2840
2841 return sample;
2842error:
2843 isl_union_map_free(umap);
2844 return NULL;
2845}
2846
2851
2852/* Return an element in "uset" in the form of an isl_point.
2853 * Return a void isl_point if "uset" is empty.
2854 */
2859
2864
2865static isl_stat forall_entry(void **entry, void *user)
2866{
2867 struct isl_forall_data *data = user;
2868 isl_map *map = *entry;
2869
2870 data->res = data->fn(map);
2871 if (data->res < 0)
2872 return isl_stat_error;
2873
2874 if (!data->res)
2875 return isl_stat_error;
2876
2877 return isl_stat_ok;
2878}
2879
2882{
2883 struct isl_forall_data data = { isl_bool_true, fn };
2884
2885 if (!umap)
2886 return isl_bool_error;
2887
2888 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2889 &forall_entry, &data) < 0 && data.res)
2890 return isl_bool_error;
2891
2892 return data.res;
2893}
2894
2900
2901static isl_stat forall_user_entry(void **entry, void *user)
2902{
2903 struct isl_forall_user_data *data = user;
2904 isl_map *map = *entry;
2905
2906 data->res = data->fn(map, data->user);
2907 if (data->res < 0)
2908 return isl_stat_error;
2909
2910 if (!data->res)
2911 return isl_stat_error;
2912
2913 return isl_stat_ok;
2914}
2915
2916/* Check if fn(map, user) returns true for all maps "map" in umap.
2917 */
2919 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user)
2920{
2921 struct isl_forall_user_data data = { isl_bool_true, fn, user };
2922
2923 if (!umap)
2924 return isl_bool_error;
2925
2926 if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
2927 &forall_user_entry, &data) < 0 && data.res)
2928 return isl_bool_error;
2929
2930 return data.res;
2931}
2932
2933/* Is "umap" obviously empty?
2934 */
2936{
2937 isl_size n;
2938
2939 n = isl_union_map_n_map(umap);
2940 if (n < 0)
2941 return isl_bool_error;
2942 return n == 0;
2943}
2944
2949
2954
2956{
2957 isl_bool is_subset;
2958 isl_space *space;
2959 isl_map *id;
2961
2963 if (match < 0)
2964 return isl_bool_error;
2965 if (!match)
2966 return isl_bool_false;
2967
2968 space = isl_map_get_space(map);
2969 id = isl_map_identity(space);
2970
2971 is_subset = isl_map_is_subset(map, id);
2972
2973 isl_map_free(id);
2974
2975 return is_subset;
2976}
2977
2978/* Given an isl_union_map that consists of a single map, check
2979 * if it is single-valued.
2980 */
2982{
2983 isl_map *map;
2984 isl_bool sv;
2985
2986 umap = isl_union_map_copy(umap);
2990
2991 return sv;
2992}
2993
2994/* Internal data structure for single_valued_on_domain.
2995 *
2996 * "umap" is the union map to be tested.
2997 * "sv" is set to 1 as long as "umap" may still be single-valued.
2998 */
3003
3004/* Check if the data->umap is single-valued on "set".
3005 *
3006 * If data->umap consists of a single map on "set", then test it
3007 * as an isl_map.
3008 *
3009 * Otherwise, compute
3010 *
3011 * M \circ M^-1
3012 *
3013 * check if the result is a subset of the identity mapping and
3014 * store the result in data->sv.
3015 *
3016 * Terminate as soon as data->umap has been determined not to
3017 * be single-valued.
3018 */
3020{
3021 struct isl_union_map_is_sv_data *data = user;
3023 isl_size n;
3024
3025 umap = isl_union_map_copy(data->umap);
3028
3030 if (n < 0) {
3031 data->sv = isl_bool_error;
3032 } else if (n == 1) {
3035 } else {
3038
3040
3042 }
3043
3044 if (data->sv < 0 || !data->sv)
3045 return isl_stat_error;
3046 return isl_stat_ok;
3047}
3048
3049/* Check if the given map is single-valued.
3050 *
3051 * If the union map consists of a single map, then test it as an isl_map.
3052 * Otherwise, check if the union map is single-valued on each of its
3053 * domain spaces.
3054 */
3056{
3059 struct isl_union_map_is_sv_data data;
3060 isl_size n;
3061
3063 if (n < 0)
3064 return isl_bool_error;
3065 if (n == 1)
3067
3070
3071 data.sv = isl_bool_true;
3072 data.umap = umap;
3074 &single_valued_on_domain, &data) < 0 && data.sv)
3075 data.sv = isl_bool_error;
3077
3078 return data.sv;
3079}
3080
3092
3093/* Is "map" obviously not an identity relation because
3094 * it maps elements from one space to another space?
3095 * Update *non_identity accordingly.
3096 *
3097 * In particular, if the domain and range spaces are the same,
3098 * then the map is not considered to obviously not be an identity relation.
3099 * Otherwise, the map is considered to obviously not be an identity relation
3100 * if it is is non-empty.
3101 *
3102 * If "map" is determined to obviously not be an identity relation,
3103 * then the search is aborted.
3104 */
3106{
3107 isl_bool *non_identity = user;
3109
3111 if (equal >= 0 && !equal)
3112 *non_identity = isl_bool_not(isl_map_is_empty(map));
3113 else
3114 *non_identity = isl_bool_not(equal);
3116
3117 if (*non_identity < 0 || *non_identity)
3118 return isl_stat_error;
3119
3120 return isl_stat_ok;
3121}
3122
3123/* Is "umap" obviously not an identity relation because
3124 * it maps elements from one space to another space?
3125 *
3126 * As soon as a map has been found that maps elements to a different space,
3127 * non_identity is changed and the search is aborted.
3128 */
3131{
3132 isl_bool non_identity;
3133
3134 non_identity = isl_bool_false;
3136 &non_identity) < 0 &&
3137 non_identity == isl_bool_false)
3138 return isl_bool_error;
3139
3140 return non_identity;
3141}
3142
3143/* Does "map" only map elements to themselves?
3144 * Update *identity accordingly.
3145 *
3146 * If "map" is determined not to be an identity relation,
3147 * then the search is aborted.
3148 */
3150{
3152
3155
3156 if (*identity < 0 || !*identity)
3157 return isl_stat_error;
3158
3159 return isl_stat_ok;
3160}
3161
3162/* Does "umap" only map elements to themselves?
3163 *
3164 * First check if there are any maps that map elements to different spaces.
3165 * If not, then check that all the maps (between identical spaces)
3166 * are identity relations.
3167 */
3169{
3170 isl_bool non_identity;
3172
3174 if (non_identity < 0 || non_identity)
3175 return isl_bool_not(non_identity);
3176
3180 return isl_bool_error;
3181
3182 return identity;
3183}
3184
3185/* Represents a map that has a fixed value (v) for one of its
3186 * range dimensions.
3187 * The map in this structure is not reference counted, so it
3188 * is only valid while the isl_union_map from which it was
3189 * obtained is still alive.
3190 */
3195
3197 int n)
3198{
3199 int i;
3200 struct isl_fixed_map *v;
3201
3202 v = isl_calloc_array(ctx, struct isl_fixed_map, n);
3203 if (!v)
3204 return NULL;
3205 for (i = 0; i < n; ++i)
3206 isl_int_init(v[i].v);
3207 return v;
3208}
3209
3211{
3212 int i;
3213
3214 if (!v)
3215 return;
3216 for (i = 0; i < n; ++i)
3217 isl_int_clear(v[i].v);
3218 free(v);
3219}
3220
3221/* Compare the "v" field of two isl_fixed_map structs.
3222 */
3223static int qsort_fixed_map_cmp(const void *p1, const void *p2)
3224{
3225 const struct isl_fixed_map *e1 = (const struct isl_fixed_map *) p1;
3226 const struct isl_fixed_map *e2 = (const struct isl_fixed_map *) p2;
3227
3228 return isl_int_cmp(e1->v, e2->v);
3229}
3230
3231/* Internal data structure used while checking whether all maps
3232 * in a union_map have a fixed value for a given output dimension.
3233 * v is the list of maps, with the fixed value for the dimension
3234 * n is the number of maps considered so far
3235 * pos is the output dimension under investigation
3236 */
3239 int n;
3240 int pos;
3241};
3242
3244{
3245 struct isl_fixed_dim_data *data = user;
3246
3247 data->v[data->n].map = map;
3249 &data->v[data->n++].v);
3250}
3251
3253 int first, int n_range);
3254
3255/* Given a list of the maps, with their fixed values at output dimension "pos",
3256 * check whether the ranges of the maps form an obvious partition.
3257 *
3258 * We first sort the maps according to their fixed values.
3259 * If all maps have a different value, then we know the ranges form
3260 * a partition.
3261 * Otherwise, we collect the maps with the same fixed value and
3262 * check whether each such collection is obviously injective
3263 * based on later dimensions.
3264 */
3265static int separates(struct isl_fixed_map *v, int n,
3266 __isl_take isl_space *space, int pos, int n_range)
3267{
3268 int i;
3269
3270 if (!v)
3271 goto error;
3272
3273 qsort(v, n, sizeof(*v), &qsort_fixed_map_cmp);
3274
3275 for (i = 0; i + 1 < n; ++i) {
3276 int j, k;
3277 isl_union_map *part;
3278 int injective;
3279
3280 for (j = i + 1; j < n; ++j)
3281 if (isl_int_ne(v[i].v, v[j].v))
3282 break;
3283
3284 if (j == i + 1)
3285 continue;
3286
3287 part = isl_union_map_alloc(isl_space_copy(space), j - i);
3288 for (k = i; k < j; ++k)
3289 part = isl_union_map_add_map(part,
3290 isl_map_copy(v[k].map));
3291
3292 injective = plain_injective_on_range(part, pos + 1, n_range);
3293 if (injective < 0)
3294 goto error;
3295 if (!injective)
3296 break;
3297
3298 i = j - 1;
3299 }
3300
3301 isl_space_free(space);
3303 return i + 1 >= n;
3304error:
3305 isl_space_free(space);
3307 return -1;
3308}
3309
3310/* Check whether the maps in umap have obviously distinct ranges.
3311 * In particular, check for an output dimension in the range
3312 * [first,n_range) for which all maps have a fixed value
3313 * and then check if these values, possibly along with fixed values
3314 * at later dimensions, entail distinct ranges.
3315 */
3317 int first, int n_range)
3318{
3319 isl_ctx *ctx;
3320 isl_size n;
3321 struct isl_fixed_dim_data data = { NULL };
3322
3323 ctx = isl_union_map_get_ctx(umap);
3324
3325 n = isl_union_map_n_map(umap);
3326 if (n < 0)
3327 goto error;
3328
3329 if (n <= 1) {
3330 isl_union_map_free(umap);
3331 return isl_bool_true;
3332 }
3333
3334 if (first >= n_range) {
3335 isl_union_map_free(umap);
3336 return isl_bool_false;
3337 }
3338
3339 data.v = alloc_isl_fixed_map_array(ctx, n);
3340 if (!data.v)
3341 goto error;
3342
3343 for (data.pos = first; data.pos < n_range; ++data.pos) {
3344 isl_bool fixed;
3345 int injective;
3346 isl_space *space;
3347
3348 data.n = 0;
3349 fixed = union_map_forall_user(umap, &fixed_at_pos, &data);
3350 if (fixed < 0)
3351 goto error;
3352 if (!fixed)
3353 continue;
3354 space = isl_union_map_get_space(umap);
3355 injective = separates(data.v, n, space, data.pos, n_range);
3356 isl_union_map_free(umap);
3357 return injective;
3358 }
3359
3361 isl_union_map_free(umap);
3362
3363 return isl_bool_false;
3364error:
3366 isl_union_map_free(umap);
3367 return isl_bool_error;
3368}
3369
3370/* Check whether the maps in umap that map to subsets of "ran"
3371 * have obviously distinct ranges.
3372 */
3374 void *user)
3375{
3376 isl_size dim;
3377 isl_union_map *umap = user;
3378
3379 dim = isl_set_dim(ran, isl_dim_set);
3380 if (dim < 0)
3381 return isl_bool_error;
3382
3383 umap = isl_union_map_copy(umap);
3386 return plain_injective_on_range(umap, 0, dim);
3387}
3388
3389/* Check if the given union_map is obviously injective.
3390 *
3391 * In particular, we first check if all individual maps are obviously
3392 * injective and then check if all the ranges of these maps are
3393 * obviously disjoint.
3394 */
3396{
3397 isl_bool in;
3398 isl_union_map *univ;
3399 isl_union_set *ran;
3400
3402 if (in < 0)
3403 return isl_bool_error;
3404 if (!in)
3405 return isl_bool_false;
3406
3408 ran = isl_union_map_range(univ);
3409
3411
3412 isl_union_set_free(ran);
3413
3414 return in;
3415}
3416
3418{
3419 isl_bool sv;
3420
3422 if (sv < 0 || !sv)
3423 return sv;
3424
3425 return isl_union_map_is_injective(umap);
3426}
3427
3429{
3430 struct isl_un_op_drop_user_data data = { &isl_map_can_zip };
3431 struct isl_un_op_control control = {
3432 .filter = &un_op_filter_drop_user,
3433 .filter_user = &data,
3434 .fn_map = &isl_map_zip,
3435 };
3436 return un_op(umap, &control);
3437}
3438
3439/* Given a union map, take the maps of the form A -> (B -> C) and
3440 * return the union of the corresponding maps (A -> B) -> C.
3441 */
3443{
3445 struct isl_un_op_control control = {
3446 .filter = &un_op_filter_drop_user,
3447 .filter_user = &data,
3448 .fn_map = &isl_map_uncurry,
3449 };
3450 return un_op(umap, &control);
3451}
3452
3453/* Given a union map, take the maps of the form (A -> B) -> C and
3454 * return the union of the corresponding maps A -> (B -> C).
3455 */
3457{
3459 struct isl_un_op_control control = {
3460 .filter = &un_op_filter_drop_user,
3461 .filter_user = &data,
3462 .fn_map = &isl_map_curry,
3463 };
3464 return un_op(umap, &control);
3465}
3466
3467/* Given a union map, take the maps of the form A -> ((B -> C) -> D) and
3468 * return the union of the corresponding maps A -> (B -> (C -> D)).
3469 */
3472{
3474 struct isl_un_op_control control = {
3475 .filter = &un_op_filter_drop_user,
3476 .filter_user = &data,
3477 .fn_map = &isl_map_range_curry,
3478 };
3479 return un_op(umap, &control);
3480}
3481
3483{
3484 struct isl_un_op_control control = {
3485 .fn_map = &isl_set_lift,
3486 };
3487 return un_op(uset, &control);
3488}
3489
3490static isl_stat coefficients_entry(void **entry, void *user)
3491{
3492 isl_set *set = *entry;
3494
3495 set = isl_set_copy(set);
3498
3499 return isl_stat_ok;
3500}
3501
3504{
3505 isl_ctx *ctx;
3506 isl_space *space;
3508
3509 if (!uset)
3510 return NULL;
3511
3512 ctx = isl_union_set_get_ctx(uset);
3513 space = isl_space_set_alloc(ctx, 0, 0);
3514 res = isl_union_map_alloc(space, uset->table.n);
3515 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table,
3516 &coefficients_entry, &res) < 0)
3517 goto error;
3518
3519 isl_union_set_free(uset);
3520 return res;
3521error:
3522 isl_union_set_free(uset);
3524 return NULL;
3525}
3526
3527static isl_stat solutions_entry(void **entry, void *user)
3528{
3529 isl_set *set = *entry;
3531
3532 set = isl_set_copy(set);
3534 if (!*res)
3536 else
3538
3539 if (!*res)
3540 return isl_stat_error;
3541
3542 return isl_stat_ok;
3543}
3544
3547{
3548 isl_union_set *res = NULL;
3549
3550 if (!uset)
3551 return NULL;
3552
3553 if (uset->table.n == 0) {
3555 isl_union_set_free(uset);
3556 return res;
3557 }
3558
3559 if (isl_hash_table_foreach(uset->dim->ctx, &uset->table,
3560 &solutions_entry, &res) < 0)
3561 goto error;
3562
3563 isl_union_set_free(uset);
3564 return res;
3565error:
3566 isl_union_set_free(uset);
3568 return NULL;
3569}
3570
3571/* Is the domain space of "map" equal to "space"?
3572 */
3578
3579/* Is the range space of "map" equal to "space"?
3580 */
3586
3587/* Is the set space of "map" equal to "space"?
3588 */
3590{
3592 space, isl_dim_out);
3593}
3594
3595/* Internal data structure for preimage_pw_multi_aff.
3596 *
3597 * "pma" is the function under which the preimage should be taken.
3598 * "space" is the space of "pma".
3599 * "res" collects the results.
3600 * "fn" computes the preimage for a given map.
3601 * "match" returns true if "fn" can be called.
3602 */
3611
3612/* Call data->fn to compute the preimage of the domain or range of *entry
3613 * under the function represented by data->pma, provided the domain/range
3614 * space of *entry matches the target space of data->pma
3615 * (as given by data->match), and add the result to data->res.
3616 */
3617static isl_stat preimage_entry(void **entry, void *user)
3618{
3619 int m;
3620 isl_map *map = *entry;
3621 struct isl_union_map_preimage_data *data = user;
3622 isl_bool empty;
3623
3624 m = data->match(map, data->space);
3625 if (m < 0)
3626 return isl_stat_error;
3627 if (!m)
3628 return isl_stat_ok;
3629
3630 map = isl_map_copy(map);
3631 map = data->fn(map, isl_pw_multi_aff_copy(data->pma));
3632
3633 empty = isl_map_is_empty(map);
3634 if (empty < 0 || empty) {
3636 return empty < 0 ? isl_stat_error : isl_stat_ok;
3637 }
3638
3639 data->res = isl_union_map_add_map(data->res, map);
3640
3641 return isl_stat_ok;
3642}
3643
3644/* Compute the preimage of the domain or range of "umap" under the function
3645 * represented by "pma".
3646 * In other words, plug in "pma" in the domain or range of "umap".
3647 * The function "fn" performs the actual preimage computation on a map,
3648 * while "match" determines to which maps the function should be applied.
3649 */
3655{
3656 isl_ctx *ctx;
3658 struct isl_union_map_preimage_data data;
3659
3660 umap = isl_union_map_align_params(umap,
3663
3664 if (!umap || !pma)
3665 goto error;
3666
3667 ctx = isl_union_map_get_ctx(umap);
3670 data.pma = pma;
3671 data.res = isl_union_map_alloc(space, umap->table.n);
3672 data.match = match;
3673 data.fn = fn;
3674 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_entry,
3675 &data) < 0)
3676 data.res = isl_union_map_free(data.res);
3677
3678 isl_space_free(data.space);
3679 isl_union_map_free(umap);
3681 return data.res;
3682error:
3683 isl_union_map_free(umap);
3685 return NULL;
3686}
3687
3688/* Compute the preimage of the domain of "umap" under the function
3689 * represented by "pma".
3690 * In other words, plug in "pma" in the domain of "umap".
3691 * The result contains maps that live in the same spaces as the maps of "umap"
3692 * with domain space equal to the target space of "pma",
3693 * except that the domain has been replaced by the domain space of "pma".
3694 */
3701
3702/* Compute the preimage of the range of "umap" under the function
3703 * represented by "pma".
3704 * In other words, plug in "pma" in the range of "umap".
3705 * The result contains maps that live in the same spaces as the maps of "umap"
3706 * with range space equal to the target space of "pma",
3707 * except that the range has been replaced by the domain space of "pma".
3708 */
3715
3716/* Compute the preimage of "uset" under the function represented by "pma".
3717 * In other words, plug in "pma" in "uset".
3718 * The result contains sets that live in the same spaces as the sets of "uset"
3719 * with space equal to the target space of "pma",
3720 * except that the space has been replaced by the domain space of "pma".
3721 */
3728
3729/* Compute the preimage of the domain of "umap" under the function
3730 * represented by "ma".
3731 * In other words, plug in "ma" in the domain of "umap".
3732 * The result contains maps that live in the same spaces as the maps of "umap"
3733 * with domain space equal to the target space of "ma",
3734 * except that the domain has been replaced by the domain space of "ma".
3735 */
3742
3743/* Compute the preimage of the range of "umap" under the function
3744 * represented by "ma".
3745 * In other words, plug in "ma" in the range of "umap".
3746 * The result contains maps that live in the same spaces as the maps of "umap"
3747 * with range space equal to the target space of "ma",
3748 * except that the range has been replaced by the domain space of "ma".
3749 */
3756
3757/* Compute the preimage of "uset" under the function represented by "ma".
3758 * In other words, plug in "ma" in "uset".
3759 * The result contains sets that live in the same spaces as the sets of "uset"
3760 * with space equal to the target space of "ma",
3761 * except that the space has been replaced by the domain space of "ma".
3762 */
3769
3770/* Internal data structure for preimage_multi_pw_aff.
3771 *
3772 * "mpa" is the function under which the preimage should be taken.
3773 * "space" is the space of "mpa".
3774 * "res" collects the results.
3775 * "fn" computes the preimage for a given map.
3776 * "match" returns true if "fn" can be called.
3777 */
3786
3787/* Call data->fn to compute the preimage of the domain or range of *entry
3788 * under the function represented by data->mpa, provided the domain/range
3789 * space of *entry matches the target space of data->mpa
3790 * (as given by data->match), and add the result to data->res.
3791 */
3792static isl_stat preimage_mpa_entry(void **entry, void *user)
3793{
3794 int m;
3795 isl_map *map = *entry;
3797 isl_bool empty;
3798
3799 m = data->match(map, data->space);
3800 if (m < 0)
3801 return isl_stat_error;
3802 if (!m)
3803 return isl_stat_ok;
3804
3805 map = isl_map_copy(map);
3806 map = data->fn(map, isl_multi_pw_aff_copy(data->mpa));
3807
3808 empty = isl_map_is_empty(map);
3809 if (empty < 0 || empty) {
3811 return empty < 0 ? isl_stat_error : isl_stat_ok;
3812 }
3813
3814 data->res = isl_union_map_add_map(data->res, map);
3815
3816 return isl_stat_ok;
3817}
3818
3819/* Compute the preimage of the domain or range of "umap" under the function
3820 * represented by "mpa".
3821 * In other words, plug in "mpa" in the domain or range of "umap".
3822 * The function "fn" performs the actual preimage computation on a map,
3823 * while "match" determines to which maps the function should be applied.
3824 */
3830{
3831 isl_ctx *ctx;
3834
3835 umap = isl_union_map_align_params(umap,
3836 isl_multi_pw_aff_get_space(mpa));
3837 mpa = isl_multi_pw_aff_align_params(mpa, isl_union_map_get_space(umap));
3838
3839 if (!umap || !mpa)
3840 goto error;
3841
3842 ctx = isl_union_map_get_ctx(umap);
3844 data.space = isl_multi_pw_aff_get_space(mpa);
3845 data.mpa = mpa;
3846 data.res = isl_union_map_alloc(space, umap->table.n);
3847 data.match = match;
3848 data.fn = fn;
3849 if (isl_hash_table_foreach(ctx, &umap->table, &preimage_mpa_entry,
3850 &data) < 0)
3851 data.res = isl_union_map_free(data.res);
3852
3853 isl_space_free(data.space);
3854 isl_union_map_free(umap);
3855 isl_multi_pw_aff_free(mpa);
3856 return data.res;
3857error:
3858 isl_union_map_free(umap);
3859 isl_multi_pw_aff_free(mpa);
3860 return NULL;
3861}
3862
3863/* Compute the preimage of the domain of "umap" under the function
3864 * represented by "mpa".
3865 * In other words, plug in "mpa" in the domain of "umap".
3866 * The result contains maps that live in the same spaces as the maps of "umap"
3867 * with domain space equal to the target space of "mpa",
3868 * except that the domain has been replaced by the domain space of "mpa".
3869 */
3876
3877/* Internal data structure for preimage_upma.
3878 *
3879 * "umap" is the map of which the preimage should be computed.
3880 * "res" collects the results.
3881 * "fn" computes the preimage for a given piecewise multi-affine function.
3882 */
3889
3890/* Call data->fn to compute the preimage of the domain or range of data->umap
3891 * under the function represented by pma and add the result to data->res.
3892 */
3894{
3897
3898 umap = isl_union_map_copy(data->umap);
3899 umap = data->fn(umap, pma);
3900 data->res = isl_union_map_union(data->res, umap);
3901
3902 return data->res ? isl_stat_ok : isl_stat_error;
3903}
3904
3905/* Compute the preimage of the domain or range of "umap" under the function
3906 * represented by "upma".
3907 * In other words, plug in "upma" in the domain or range of "umap".
3908 * The function "fn" performs the actual preimage computation
3909 * on a piecewise multi-affine function.
3910 */
3931
3932/* Compute the preimage of the domain of "umap" under the function
3933 * represented by "upma".
3934 * In other words, plug in "upma" in the domain of "umap".
3935 * The result contains maps that live in the same spaces as the maps of "umap"
3936 * with domain space equal to one of the target spaces of "upma",
3937 * except that the domain has been replaced by one of the domain spaces that
3938 * correspond to that target space of "upma".
3939 */
3947
3948/* Compute the preimage of the range of "umap" under the function
3949 * represented by "upma".
3950 * In other words, plug in "upma" in the range of "umap".
3951 * The result contains maps that live in the same spaces as the maps of "umap"
3952 * with range space equal to one of the target spaces of "upma",
3953 * except that the range has been replaced by one of the domain spaces that
3954 * correspond to that target space of "upma".
3955 */
3963
3964/* Compute the preimage of "uset" under the function represented by "upma".
3965 * In other words, plug in "upma" in the range of "uset".
3966 * The result contains sets that live in the same spaces as the sets of "uset"
3967 * with space equal to one of the target spaces of "upma",
3968 * except that the space has been replaced by one of the domain spaces that
3969 * correspond to that target space of "upma".
3970 */
3978
3979/* Reset the user pointer on all identifiers of parameters and tuples
3980 * of the spaces of "umap".
3981 */
3984{
3986 if (!umap)
3987 return NULL;
3989 if (!umap->dim)
3990 return isl_union_map_free(umap);
3991 return total(umap, &isl_map_reset_user);
3992}
3993
3994/* Reset the user pointer on all identifiers of parameters and tuples
3995 * of the spaces of "uset".
3996 */
4002
4003/* Remove all existentially quantified variables and integer divisions
4004 * from "umap" using Fourier-Motzkin elimination.
4005 */
4011
4012/* Remove all existentially quantified variables and integer divisions
4013 * from "uset" using Fourier-Motzkin elimination.
4014 */
4020
4021/* Internal data structure for isl_union_map_project_out.
4022 * "type", "first" and "n" are the arguments for the isl_map_project_out
4023 * call.
4024 * "res" collects the results.
4025 */
4033
4034/* Turn the data->n dimensions of type data->type, starting at data->first
4035 * into existentially quantified variables and add the result to data->res.
4036 */
4038{
4039 struct isl_union_map_project_out_data *data = user;
4040
4041 map = isl_map_project_out(map, data->type, data->first, data->n);
4042 data->res = isl_union_map_add_map(data->res, map);
4043
4044 return isl_stat_ok;
4045}
4046
4047/* Turn the "n" dimensions of type "type", starting at "first"
4048 * into existentially quantified variables.
4049 * Since the space of an isl_union_map only contains parameters,
4050 * type is required to be equal to isl_dim_param.
4051 */
4054 enum isl_dim_type type, unsigned first, unsigned n)
4055{
4056 isl_space *space;
4057 struct isl_union_map_project_out_data data = { type, first, n };
4058
4059 if (!umap)
4060 return NULL;
4061
4062 if (type != isl_dim_param)
4064 "can only project out parameters",
4065 return isl_union_map_free(umap));
4066
4067 space = isl_union_map_get_space(umap);
4068 space = isl_space_drop_dims(space, type, first, n);
4069 data.res = isl_union_map_empty(space);
4070 if (isl_union_map_foreach_map(umap, &project_out, &data) < 0)
4071 data.res = isl_union_map_free(data.res);
4072
4073 isl_union_map_free(umap);
4074
4075 return data.res;
4076}
4077
4078#undef TYPE
4079#define TYPE isl_union_map
4082
4083/* Turn the "n" dimensions of type "type", starting at "first"
4084 * into existentially quantified variables.
4085 * Since the space of an isl_union_set only contains parameters,
4086 * "type" is required to be equal to isl_dim_param.
4087 */
4090 enum isl_dim_type type, unsigned first, unsigned n)
4091{
4092 return isl_union_map_project_out(uset, type, first, n);
4093}
4094
4095/* Project out all parameters from "uset" by existentially quantifying
4096 * over them.
4097 */
4104
4105/* Internal data structure for isl_union_map_involves_dims.
4106 * "first" and "n" are the arguments for the isl_map_involves_dims calls.
4107 */
4109 unsigned first;
4110 unsigned n;
4111};
4112
4113/* Does "map" _not_ involve the data->n parameters starting at data->first?
4114 */
4116{
4118 isl_bool involves;
4119
4120 involves = isl_map_involves_dims(map,
4121 isl_dim_param, data->first, data->n);
4122 return isl_bool_not(involves);
4123}
4124
4125/* Does "umap" involve any of the n parameters starting at first?
4126 * "type" is required to be set to isl_dim_param.
4127 *
4128 * "umap" involves any of those parameters if any of its maps
4129 * involve the parameters. In other words, "umap" does not
4130 * involve any of the parameters if all its maps to not
4131 * involve the parameters.
4132 */
4134 enum isl_dim_type type, unsigned first, unsigned n)
4135{
4136 struct isl_union_map_involves_dims_data data = { first, n };
4137 isl_bool excludes;
4138
4139 if (type != isl_dim_param)
4141 "can only reference parameters", return isl_bool_error);
4142
4143 excludes = union_map_forall_user(umap, &map_excludes, &data);
4144
4145 return isl_bool_not(excludes);
4146}
4147
4148/* Internal data structure for isl_union_map_reset_range_space.
4149 * "range" is the space from which to set the range space.
4150 * "res" collects the results.
4151 */
4156
4157/* Replace the range space of "map" by the range space of data->range and
4158 * add the result to data->res.
4159 */
4161{
4163 isl_space *space;
4164
4165 space = isl_map_get_space(map);
4166 space = isl_space_domain(space);
4168 isl_space_copy(data->range));
4169 map = isl_map_reset_space(map, space);
4170 data->res = isl_union_map_add_map(data->res, map);
4171
4172 return data->res ? isl_stat_ok : isl_stat_error;
4173}
4174
4175/* Replace the range space of all the maps in "umap" by
4176 * the range space of "space".
4177 *
4178 * This assumes that all maps have the same output dimension.
4179 * This function should therefore not be made publicly available.
4180 *
4181 * Since the spaces of the maps change, so do their hash value.
4182 * We therefore need to create a new isl_union_map.
4183 */
4186{
4187 struct isl_union_map_reset_range_space_data data = { space };
4188
4190 if (isl_union_map_foreach_map(umap, &reset_range_space, &data) < 0)
4191 data.res = isl_union_map_free(data.res);
4192
4193 isl_space_free(space);
4194 isl_union_map_free(umap);
4195 return data.res;
4196}
4197
4198/* Check that "umap" and "space" have the same number of parameters.
4199 */
4201 __isl_keep isl_space *space)
4202{
4203 isl_size dim1, dim2;
4204
4205 dim1 = isl_union_map_dim(umap, isl_dim_param);
4206 dim2 = isl_space_dim(space, isl_dim_param);
4207 if (dim1 < 0 || dim2 < 0)
4208 return isl_stat_error;
4209 if (dim1 == dim2)
4210 return isl_stat_ok;
4212 "number of parameters does not match", return isl_stat_error);
4213}
4214
4215/* Internal data structure for isl_union_map_reset_equal_dim_space.
4216 * "space" is the target space.
4217 * "res" collects the results.
4218 */
4223
4224/* Replace the parameters of "map" by those of data->space and
4225 * add the result to data->res.
4226 */
4228{
4231
4235 data->res = isl_union_map_add_map(data->res, map);
4236
4237 return data->res ? isl_stat_ok : isl_stat_error;
4238}
4239
4240/* Replace the space of "umap" by "space", without modifying
4241 * the dimension of "umap", i.e., the number of parameters of "umap".
4242 *
4243 * Since the hash values of the maps in the union map depend
4244 * on the parameters, a new union map needs to be constructed.
4245 */
4248{
4249 struct isl_union_map_reset_params_data data = { space };
4251 isl_space *umap_space;
4252
4253 umap_space = isl_union_map_peek_space(umap);
4254 equal = isl_space_is_equal(umap_space, space);
4255 if (equal < 0)
4256 goto error;
4257 if (equal) {
4259 return umap;
4260 }
4262 goto error;
4263
4265 if (isl_union_map_foreach_map(umap, &reset_params, &data) < 0)
4266 data.res = isl_union_map_free(data.res);
4267
4269 isl_union_map_free(umap);
4270 return data.res;
4271error:
4272 isl_union_map_free(umap);
4274 return NULL;
4275}
4276
4277/* Internal data structure for isl_union_map_order_at_multi_union_pw_aff.
4278 * "mupa" is the function from which the isl_multi_pw_affs are extracted.
4279 * "order" is applied to the extracted isl_multi_pw_affs that correspond
4280 * to the domain and the range of each map.
4281 * "res" collects the results.
4282 */
4289
4290/* Intersect "map" with the result of applying data->order to
4291 * the functions in data->mupa that apply to the domain and the range
4292 * of "map" and add the result to data->res.
4293 */
4295{
4296 struct isl_union_order_at_data *data = user;
4297 isl_space *space;
4298 isl_multi_pw_aff *mpa1, *mpa2;
4299 isl_map *order;
4300
4305 order = data->order(mpa1, mpa2);
4307 data->res = isl_union_map_add_map(data->res, map);
4308
4309 return data->res ? isl_stat_ok : isl_stat_error;
4310}
4311
4312/* If "mupa" has a non-trivial explicit domain, then intersect
4313 * domain and range of "umap" with this explicit domain.
4314 * If the explicit domain only describes constraints on the parameters,
4315 * then the intersection only needs to be performed once.
4316 */
4319{
4320 isl_bool non_trivial, is_params;
4321 isl_union_set *dom;
4322
4324 if (non_trivial < 0)
4325 return isl_union_map_free(umap);
4326 if (!non_trivial)
4327 return umap;
4328 mupa = isl_multi_union_pw_aff_copy(mupa);
4330 is_params = isl_union_set_is_params(dom);
4331 if (is_params < 0) {
4332 isl_union_set_free(dom);
4333 return isl_union_map_free(umap);
4334 }
4335 if (is_params) {
4336 isl_set *set;
4337
4339 umap = isl_union_map_intersect_params(umap, set);
4340 return umap;
4341 }
4343 umap = isl_union_map_intersect_range(umap, dom);
4344 return umap;
4345}
4346
4347/* Intersect each map in "umap" with the result of calling "order"
4348 * on the functions is "mupa" that apply to the domain and the range
4349 * of the map.
4350 */
4355{
4356 struct isl_union_order_at_data data;
4357
4358 umap = isl_union_map_align_params(umap,
4359 isl_multi_union_pw_aff_get_space(mupa));
4360 mupa = isl_multi_union_pw_aff_align_params(mupa,
4362 umap = intersect_explicit_domain(umap, mupa);
4363 data.mupa = mupa;
4364 data.order = order;
4366 if (isl_union_map_foreach_map(umap, &order_at, &data) < 0)
4367 data.res = isl_union_map_free(data.res);
4368
4369 isl_multi_union_pw_aff_free(mupa);
4370 isl_union_map_free(umap);
4371 return data.res;
4372}
4373
4374/* Return the subset of "umap" where the domain and the range
4375 * have equal "mupa" values.
4376 */
4384
4385#undef ORDER
4386#define ORDER le
4388
4389#undef ORDER
4390#define ORDER lt
4392
4393#undef ORDER
4394#define ORDER ge
4396
4397#undef ORDER
4398#define ORDER gt
4400
4401/* Return the union of the elements in the list "list".
4402 */
4405{
4406 int i;
4407 isl_size n;
4408 isl_ctx *ctx;
4409 isl_space *space;
4411
4412 n = isl_union_set_list_n_union_set(list);
4413 if (n < 0)
4414 goto error;
4415
4416 ctx = isl_union_set_list_get_ctx(list);
4417 space = isl_space_params_alloc(ctx, 0);
4418 res = isl_union_set_empty(space);
4419
4420 for (i = 0; i < n; ++i) {
4421 isl_union_set *uset_i;
4422
4423 uset_i = isl_union_set_list_get_union_set(list, i);
4424 res = isl_union_set_union(res, uset_i);
4425 }
4426
4427 isl_union_set_list_free(list);
4428 return res;
4429error:
4430 isl_union_set_list_free(list);
4431 return NULL;
4432}
4433
4434/* Update *hash with the hash value of "map".
4435 */
4437{
4438 uint32_t *hash = user;
4439 uint32_t map_hash;
4440
4441 map_hash = isl_map_get_hash(map);
4442 isl_hash_hash(*hash, map_hash);
4443
4445 return isl_stat_ok;
4446}
4447
4448/* Return a hash value that digests "umap".
4449 */
4451{
4452 uint32_t hash;
4453
4454 if (!umap)
4455 return 0;
4456
4457 hash = isl_hash_init();
4458 if (isl_union_map_foreach_map(umap, &add_hash, &hash) < 0)
4459 return 0;
4460
4461 return hash;
4462}
4463
4464/* Return a hash value that digests "uset".
4465 */
4467{
4468 return isl_union_map_get_hash(uset);
4469}
4470
4471/* Add the number of basic sets in "set" to "n".
4472 */
4474{
4475 int *n = user;
4476 isl_size set_n;
4477
4478 set_n = isl_set_n_basic_set(set);
4479 *n += set_n;
4481
4482 return set_n < 0 ? isl_stat_error : isl_stat_ok;
4483}
4484
4485/* Return the total number of basic sets in "uset".
4486 */
4488{
4489 int n = 0;
4490
4491 if (isl_union_set_foreach_set(uset, &add_n, &n) < 0)
4492 return -1;
4493
4494 return n;
4495}
4496
4497/* Add the basic sets in "set" to "list".
4498 */
4500{
4501 isl_basic_set_list **list = user;
4502 isl_basic_set_list *list_i;
4503
4505 *list = isl_basic_set_list_concat(*list, list_i);
4507
4508 if (!*list)
4509 return isl_stat_error;
4510 return isl_stat_ok;
4511}
4512
4513/* Return a list containing all the basic sets in "uset".
4514 *
4515 * First construct a list of the appropriate size and
4516 * then add all the elements.
4517 */
4520{
4521 int n;
4522 isl_ctx *ctx;
4523 isl_basic_set_list *list;
4524
4525 if (!uset)
4526 return NULL;
4527 ctx = isl_union_set_get_ctx(uset);
4529 if (n < 0)
4530 return NULL;
4531 list = isl_basic_set_list_alloc(ctx, n);
4532 if (isl_union_set_foreach_set(uset, &add_list, &list) < 0)
4533 list = isl_basic_set_list_free(list);
4534
4535 return list;
4536}
4537
4538/* Internal data structure for isl_union_map_remove_map_if.
4539 * "fn" and "user" are the arguments to isl_union_map_remove_map_if.
4540 */
4545
4546/* isl_un_op_control filter that negates the result of data->fn
4547 * called on "map".
4548 */
4550{
4552
4553 return isl_bool_not(data->fn(map, data->user));
4554}
4555
4556/* Dummy isl_un_op_control transformation callback that
4557 * simply returns the input.
4558 */
4560{
4561 return map;
4562}
4563
4564/* Call "fn" on every map in "umap" and remove those maps
4565 * for which the callback returns true.
4566 *
4567 * Use un_op to keep only those maps that are not filtered out,
4568 * applying an identity transformation on them.
4569 */
4572 isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user)
4573{
4574 struct isl_union_map_remove_map_if_data data = { fn, user };
4575 struct isl_un_op_control control = {
4576 .filter = &not,
4577 .filter_user = &data,
4578 .fn_map = &map_id,
4579 };
4580 return un_op(umap, &control);
4581}
4582
4583/* Does "map" have "space" as domain (ignoring parameters)?
4584 */
4586{
4587 isl_space *space = user;
4588
4590}
4591
4592/* Does "map" have "space" as range (ignoring parameters)?
4593 */
4595{
4596 isl_space *space = user;
4597
4599}
4600
4601/* Wrapper around isl_map_bind_range for use as a un_op callback.
4602 */
4604{
4606
4607 return isl_map_bind_range(map, isl_multi_id_copy(tuple));
4608}
4609
4610/* Bind the output dimensions of "umap" to parameters with identifiers
4611 * specified by "tuple", living in the range space of "umap",
4612 * for those maps that have a matching range space.
4613 */
4616{
4617 struct isl_un_op_control control = {
4618 .filter = &has_range_space_tuples,
4619 .filter_user = isl_multi_id_peek_space(tuple),
4620 .fn_map2 = &bind_range,
4621 .fn_map2_user = tuple,
4622 };
4624
4625 bound = uset_from_umap(un_op(umap, &control));
4626 isl_multi_id_free(tuple);
4627 return bound;
4628}
4629
4630/* Only keep those elements in "umap" that have a domain in "space".
4631 */
4634{
4635 struct isl_un_op_control control = {
4636 .filter = &has_domain_space_tuples,
4637 .filter_user = space,
4638 };
4639
4640 umap = un_op(umap, &control);
4641 isl_space_free(space);
4642 return umap;
4643}
4644
4645/* Only keep those elements in "umap" that have a range in "space".
4646 */
4649{
4650 struct isl_un_op_control control = {
4651 .filter = &has_range_space_tuples,
4652 .filter_user = space,
4653 };
4654
4655 umap = un_op(umap, &control);
4656 isl_space_free(space);
4657 return umap;
4658}
__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:22
#define isl_calloc_type(ctx, type)
Definition ctx.h:130
isl_stat
Definition ctx.h:84
@ isl_stat_error
Definition ctx.h:85
@ isl_stat_ok
Definition ctx.h:86
#define __isl_give
Definition ctx.h:19
#define isl_size_error
Definition ctx.h:98
#define __isl_null
Definition ctx.h:28
#define isl_die(ctx, errno, msg, code)
Definition ctx.h:138
isl_bool isl_bool_ok(int b)
Definition isl_ctx.c:58
@ isl_error_invalid
Definition ctx.h:80
@ isl_error_internal
Definition ctx.h:79
#define isl_calloc_array(ctx, type, n)
Definition ctx.h:133
#define __isl_keep
Definition ctx.h:25
int isl_size
Definition ctx.h:97
isl_bool isl_bool_not(isl_bool b)
Definition isl_ctx.c:44
isl_bool
Definition ctx.h:89
@ isl_bool_false
Definition ctx.h:91
@ isl_bool_true
Definition ctx.h:92
@ isl_bool_error
Definition ctx.h:90
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:3554
enum isl_fold type
Definition isl_test.c:3867
const char * set
Definition isl_test.c:1364
const char * ma
Definition isl_test.c:7387
const char * map
Definition isl_test.c:1791
int equal
Definition isl_test.c:7720
const char * pma
Definition isl_test.c:3019
const char * name
Definition isl_test.c:10749
const char * context
Definition isl_test.c:1792
const char * map1
Definition isl_test.c:365
const char * map2
Definition isl_test.c:366
const char * set1
Definition isl_test.c:4055
const char * tuple
Definition isl_test.c:6860
const char * res
Definition isl_test.c:783
const char * set2
Definition isl_test.c:4056
const char * size
Definition isl_test.c:1578
const char * mupa
Definition isl_test.c:7217
const char * id
Definition isl_test.c:7131
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)
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)
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)
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_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