Polly 20.0.0git
isl_point.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 INRIA Saclay
3 * Copyright 2013 Ecole Normale Superieure
4 * Copyright 2015 Sven Verdoolaege
5 * Copyright 2019,2022 Cerebras Systems
6 *
7 * Use of this software is governed by the MIT license
8 *
9 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
10 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
11 * 91893 Orsay, France
12 * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
13 * and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
14 * and Cerebras Systems, 1237 E Arques Ave, Sunnyvale, CA, USA
15 */
16
17#include <isl_map_private.h>
18#include <isl_point_private.h>
19#include <isl/set.h>
20#include <isl/union_set.h>
21#include <isl_sample.h>
22#include <isl_scan.h>
23#include <isl_seq.h>
24#include <isl_space_private.h>
25#include <isl_local_private.h>
26#include <isl_val_private.h>
27#include <isl_vec_private.h>
28#include <isl_output_private.h>
29
30#include <set_to_map.c>
31
33{
34 return pnt ? isl_space_get_ctx(pnt->dim) : NULL;
35}
36
37/* Return the space of "pnt".
38 */
40{
41 return pnt ? pnt->dim : NULL;
42}
43
45{
47}
48
49#undef TYPE1
50#define TYPE1 isl_basic_map
51#undef TYPE2
52#define TYPE2 isl_point
53#undef TYPE_PAIR
54#define TYPE_PAIR isl_basic_map_point
55
56static
58static
60
61#undef TYPE
62#define TYPE isl_point
63
65
68{
69 struct isl_point *pnt;
71
73 if (dim < 0 || !vec)
74 goto error;
75
76 if (vec->size > 1 + dim) {
78 if (!vec)
79 goto error;
80 vec->size = 1 + dim;
81 }
82
83 pnt = isl_alloc_type(space->ctx, struct isl_point);
84 if (!pnt)
85 goto error;
86
87 pnt->ref = 1;
88 pnt->dim = space;
89 pnt->vec = vec;
90
91 return pnt;
92error:
93 isl_space_free(space);
95 return NULL;
96}
97
99{
100 isl_vec *vec;
102
103 dim = isl_space_dim(space, isl_dim_all);
104 if (dim < 0)
105 goto error;
106 vec = isl_vec_alloc(space->ctx, 1 + dim);
107 if (!vec)
108 goto error;
109 isl_int_set_si(vec->el[0], 1);
110 isl_seq_clr(vec->el + 1, vec->size - 1);
111 return isl_point_alloc(space, vec);
112error:
113 isl_space_free(space);
114 return NULL;
115}
116
118{
119 struct isl_point *pnt2;
120
121 if (!pnt)
122 return NULL;
123 pnt2 = isl_point_alloc(isl_space_copy(pnt->dim), isl_vec_copy(pnt->vec));
124 return pnt2;
125}
126
128{
129 struct isl_point *pnt2;
130 if (!pnt)
131 return NULL;
132
133 if (pnt->ref == 1)
134 return pnt;
135
136 pnt2 = isl_point_dup(pnt);
137 isl_point_free(pnt);
138 return pnt2;
139}
140
142{
143 if (!pnt)
144 return NULL;
145
146 pnt->ref++;
147 return pnt;
148}
149
151{
152 if (!pnt)
153 return NULL;
154
155 if (--pnt->ref > 0)
156 return NULL;
157
158 isl_space_free(pnt->dim);
159 isl_vec_free(pnt->vec);
160 free(pnt);
161 return NULL;
162}
163
165{
166 if (!space)
167 return NULL;
168
169 return isl_point_alloc(space, isl_vec_alloc(space->ctx, 0));
170}
171
173{
174 if (!pnt)
175 return isl_bool_error;
176
177 return isl_bool_ok(pnt->vec->size == 0);
178}
179
180/* Return the space of "pnt".
181 * This may be either a copy or the space itself
182 * if there is only one reference to "pnt".
183 * This allows the space to be modified inplace
184 * if both the point and its space have only a single reference.
185 * The caller is not allowed to modify "pnt" between this call and
186 * a subsequent call to isl_point_restore_space.
187 * The only exception is that isl_point_free can be called instead.
188 */
190{
191 isl_space *space;
192
193 if (!pnt)
194 return NULL;
195 if (pnt->ref != 1)
196 return isl_point_get_space(pnt);
197 space = pnt->dim;
198 pnt->dim = NULL;
199 return space;
200}
201
202/* Set the space of "pnt" to "space", where the space of "pnt" may be missing
203 * due to a preceding call to isl_point_take_space.
204 * However, in this case, "pnt" only has a single reference and
205 * then the call to isl_point_cow has no effect.
206 */
208 __isl_take isl_space *space)
209{
210 if (!pnt || !space)
211 goto error;
212
213 if (pnt->dim == space) {
214 isl_space_free(space);
215 return pnt;
216 }
217
218 pnt = isl_point_cow(pnt);
219 if (!pnt)
220 goto error;
221 isl_space_free(pnt->dim);
222 pnt->dim = space;
223
224 return pnt;
225error:
226 isl_point_free(pnt);
227 isl_space_free(space);
228 return NULL;
229}
230
231/* Return the coordinate vector of "pnt".
232 */
234{
235 return pnt ? pnt->vec : NULL;
236}
237
238/* Return a copy of the coordinate vector of "pnt".
239 */
241{
242 return isl_vec_copy(isl_point_peek_vec(pnt));
243}
244
245/* Return the coordinate vector of "pnt".
246 * This may be either a copy or the coordinate vector itself
247 * if there is only one reference to "pnt".
248 * This allows the coordinate vector to be modified inplace
249 * if both the point and its coordinate vector have only a single reference.
250 * The caller is not allowed to modify "pnt" between this call and
251 * a subsequent call to isl_point_restore_vec.
252 * The only exception is that isl_point_free can be called instead.
253 */
255{
256 isl_vec *vec;
257
258 if (!pnt)
259 return NULL;
260 if (pnt->ref != 1)
261 return isl_point_get_vec(pnt);
262 vec = pnt->vec;
263 pnt->vec = NULL;
264 return vec;
265}
266
267/* Set the coordinate vector of "pnt" to "vec",
268 * where the coordinate vector of "pnt" may be missing
269 * due to a preceding call to isl_point_take_vec.
270 * However, in this case, "pnt" only has a single reference and
271 * then the call to isl_point_cow has no effect.
272 */
275{
276 if (!pnt || !vec)
277 goto error;
278
279 if (pnt->vec == vec) {
281 return pnt;
282 }
283
284 pnt = isl_point_cow(pnt);
285 if (!pnt)
286 goto error;
287 isl_vec_free(pnt->vec);
288 pnt->vec = vec;
289
290 return pnt;
291error:
292 isl_point_free(pnt);
294 return NULL;
295}
296
297/* Return the number of variables of the given type.
298 */
300{
302}
303
304/* Return the position of the coordinates of the given type
305 * within the sequence of coordinates of "pnt".
306 */
308 enum isl_dim_type type)
309{
310 return pnt ? isl_space_offset(pnt->dim, type) : isl_size_error;
311}
312
313/* Reorder the coordinates of "pnt" based on the given reordering.
314 */
317{
318 isl_vec *vec;
319
322
323 vec = isl_point_take_vec(pnt);
325 pnt = isl_point_restore_vec(pnt, vec);
326
327 return pnt;
328}
329
330/* Align the parameters of "pnt" along those of "model".
331 *
332 * Note that "model" is not allowed to have any parameters
333 * that do not already appear in "pnt" since "pnt" does not specify
334 * any value for such parameters.
335 */
337 __isl_take isl_space *model)
338{
339 isl_space *space;
340 isl_bool equal_params;
341
342 space = isl_point_peek_space(pnt);
343 equal_params = isl_space_has_equal_params(space, model);
344 if (equal_params < 0)
345 goto error;
346 if (!equal_params) {
348
349 r = isl_parameter_alignment_reordering(space, model);
350 if (!r)
351 goto error;
352 if (r->src_len != r->dst_len)
354 "no value specified for some parameters",
355 r = isl_reordering_free(r));
356 pnt = isl_point_reorder(pnt, r);
357 }
358
359 isl_space_free(model);
360 return pnt;
361error:
362 isl_space_free(model);
363 isl_point_free(pnt);
364 return NULL;
365}
366
367#undef TYPE
368#define TYPE isl_point
369static
371
372/* Return the value of coordinate "pos" of type "type" of "pnt".
373 */
375 enum isl_dim_type type, int pos)
376{
377 isl_ctx *ctx;
378 isl_val *v;
379 isl_size off;
380
381 if (!pnt)
382 return NULL;
383
384 ctx = isl_point_get_ctx(pnt);
385 if (isl_point_is_void(pnt))
387 "void point does not have coordinates", return NULL);
388 if (isl_point_check_range(pnt, type, pos, 1) < 0)
389 return NULL;
390
391 off = isl_point_var_offset(pnt, type);
392 if (off < 0)
393 return NULL;
394 pos += off;
395
396 v = isl_val_rat_from_isl_int(ctx, pnt->vec->el[1 + pos],
397 pnt->vec->el[0]);
398 return isl_val_normalize(v);
399}
400
401/* Set all entries of "mv" to NaN.
402 */
404{
405 int i;
406 isl_size n;
407 isl_val *v;
408
409 n = isl_multi_val_size(mv);
410 if (n < 0)
411 return isl_multi_val_free(mv);
412 v = isl_val_nan(isl_multi_val_get_ctx(mv));
413 for (i = 0; i < n; ++i)
414 mv = isl_multi_val_set_at(mv, i, isl_val_copy(v));
415 isl_val_free(v);
416
417 return mv;
418}
419
420/* Return the values of the set dimensions of "pnt".
421 * Return a sequence of NaNs in case of a void point.
422 */
424{
425 int i;
426 isl_bool is_void;
427 isl_size n;
428 isl_multi_val *mv;
429
430 is_void = isl_point_is_void(pnt);
431 if (is_void < 0)
432 return NULL;
433
434 mv = isl_multi_val_alloc(isl_point_get_space(pnt));
435 if (is_void)
436 return set_nan(mv);
437 n = isl_multi_val_size(mv);
438 if (n < 0)
439 return isl_multi_val_free(mv);
440 for (i = 0; i < n; ++i) {
441 isl_val *v;
442
444 mv = isl_multi_val_set_at(mv, i, v);
445 }
446
447 return mv;
448}
449
450/* Replace coordinate "pos" of type "type" of "pnt" by "v".
451 */
453 enum isl_dim_type type, int pos, __isl_take isl_val *v)
454{
455 if (!pnt || !v)
456 goto error;
457 if (isl_point_is_void(pnt))
459 "void point does not have coordinates", goto error);
460 if (isl_point_check_range(pnt, type, pos, 1) < 0)
461 goto error;
462 if (!isl_val_is_rat(v))
464 "expecting rational value", goto error);
465
467 if (isl_int_eq(pnt->vec->el[1 + pos], v->n) &&
468 isl_int_eq(pnt->vec->el[0], v->d)) {
469 isl_val_free(v);
470 return pnt;
471 }
472
473 pnt = isl_point_cow(pnt);
474 if (!pnt)
475 goto error;
476 pnt->vec = isl_vec_cow(pnt->vec);
477 if (!pnt->vec)
478 goto error;
479
480 if (isl_int_eq(pnt->vec->el[0], v->d)) {
481 isl_int_set(pnt->vec->el[1 + pos], v->n);
482 } else if (isl_int_is_one(v->d)) {
483 isl_int_mul(pnt->vec->el[1 + pos], pnt->vec->el[0], v->n);
484 } else {
485 isl_seq_scale(pnt->vec->el + 1,
486 pnt->vec->el + 1, v->d, pnt->vec->size - 1);
487 isl_int_mul(pnt->vec->el[1 + pos], pnt->vec->el[0], v->n);
488 isl_int_mul(pnt->vec->el[0], pnt->vec->el[0], v->d);
489 pnt->vec = isl_vec_normalize(pnt->vec);
490 if (!pnt->vec)
491 goto error;
492 }
493
494 isl_val_free(v);
495 return pnt;
496error:
497 isl_val_free(v);
498 isl_point_free(pnt);
499 return NULL;
500}
501
503 enum isl_dim_type type, int pos, unsigned val)
504{
505 isl_size off;
506
507 if (!pnt || isl_point_is_void(pnt))
508 return pnt;
509
510 pnt = isl_point_cow(pnt);
511 if (!pnt)
512 return NULL;
513 pnt->vec = isl_vec_cow(pnt->vec);
514 if (!pnt->vec)
515 goto error;
516
517 off = isl_point_var_offset(pnt, type);
518 if (off < 0)
519 goto error;
520 pos += off;
521
522 isl_int_add_ui(pnt->vec->el[1 + pos], pnt->vec->el[1 + pos], val);
523
524 return pnt;
525error:
526 isl_point_free(pnt);
527 return NULL;
528}
529
531 enum isl_dim_type type, int pos, unsigned val)
532{
533 isl_size off;
534
535 if (!pnt || isl_point_is_void(pnt))
536 return pnt;
537
538 pnt = isl_point_cow(pnt);
539 if (!pnt)
540 return NULL;
541 pnt->vec = isl_vec_cow(pnt->vec);
542 if (!pnt->vec)
543 goto error;
544
545 off = isl_point_var_offset(pnt, type);
546 if (off < 0)
547 goto error;
548 pos += off;
549
550 isl_int_sub_ui(pnt->vec->el[1 + pos], pnt->vec->el[1 + pos], val);
551
552 return pnt;
553error:
554 isl_point_free(pnt);
555 return NULL;
556}
557
561 void *user;
563};
564
566 __isl_take isl_vec *sample)
567{
568 struct isl_foreach_point *fp = (struct isl_foreach_point *)cb;
569 isl_point *pnt;
570
571 pnt = isl_point_alloc(isl_space_copy(fp->dim), sample);
572
573 return fp->fn(pnt, fp->user);
574}
575
577 isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user)
578{
579 struct isl_foreach_point fp = { { &foreach_point }, fn, user };
580 int i;
581
582 if (!set)
583 return isl_stat_error;
584
586 if (!fp.dim)
587 return isl_stat_error;
588
593 if (!set)
594 goto error;
595
596 for (i = 0; i < set->n; ++i)
598 &fp.callback) < 0)
599 goto error;
600
603
604 return isl_stat_ok;
605error:
608 return isl_stat_error;
609}
610
611/* Return 1 if "bmap" contains the point "point".
612 * "bmap" is assumed to have known divs.
613 * The point is first extended with the divs and then passed
614 * to basic_map_contains.
615 */
618{
619 isl_local *local;
620 isl_vec *vec;
622
623 if (isl_basic_map_point_check_equal_space(bmap, point) < 0)
624 return isl_bool_error;
625 if (bmap->n_div == 0)
626 return isl_basic_map_contains(bmap, point->vec);
627
630 vec = isl_local_extend_point_vec(local, vec);
631 isl_local_free(local);
632
633 contains = isl_basic_map_contains(bmap, vec);
634
635 isl_vec_free(vec);
636 return contains;
637}
638
641{
642 int i;
643 isl_bool found = isl_bool_false;
644
645 if (!map || !point)
646 return isl_bool_error;
647
650 if (!map)
651 return isl_bool_error;
652
653 for (i = 0; i < map->n; ++i) {
654 found = isl_basic_map_contains_point(map->p[i], point);
655 if (found < 0)
656 goto error;
657 if (found)
658 break;
659 }
661
662 return found;
663error:
665 return isl_bool_error;
666}
667
670{
672}
673
675{
676 isl_basic_set *bset;
677 isl_basic_set *model;
678
679 if (!pnt)
680 return NULL;
681
682 model = isl_basic_set_empty(isl_space_copy(pnt->dim));
683 bset = isl_basic_set_from_vec(isl_vec_copy(pnt->vec));
684 bset = isl_basic_set_from_underlying_set(bset, model);
685 isl_point_free(pnt);
686
687 return bset;
688}
689
691{
692 isl_basic_set *bset;
693 bset = isl_basic_set_from_point(pnt);
694 return isl_set_from_basic_set(bset);
695}
696
697/* This function performs the same operation as isl_set_from_point,
698 * but is considered as a function on an isl_point when exported.
699 */
701{
702 return isl_set_from_point(pnt);
703}
704
705/* Construct a union set, containing the single element "pnt".
706 * If "pnt" is void, then return an empty union set.
707 */
709{
710 if (!pnt)
711 return NULL;
712 if (isl_point_is_void(pnt)) {
713 isl_space *space;
714
715 space = isl_point_get_space(pnt);
716 isl_point_free(pnt);
717 return isl_union_set_empty(space);
718 }
719
721}
722
725{
726 isl_basic_set *bset = NULL;
728 int i;
729 int k;
730 isl_int t;
731
733
734 if (!pnt1 || !pnt2)
735 goto error;
736
737 isl_assert(pnt1->dim->ctx,
738 isl_space_is_equal(pnt1->dim, pnt2->dim), goto error);
739
740 if (isl_point_is_void(pnt1) && isl_point_is_void(pnt2)) {
741 isl_space *space = isl_space_copy(pnt1->dim);
742 isl_point_free(pnt1);
743 isl_point_free(pnt2);
745 return isl_basic_set_empty(space);
746 }
747 if (isl_point_is_void(pnt1)) {
748 isl_point_free(pnt1);
750 return isl_basic_set_from_point(pnt2);
751 }
752 if (isl_point_is_void(pnt2)) {
753 isl_point_free(pnt2);
755 return isl_basic_set_from_point(pnt1);
756 }
757
759 if (total < 0)
760 goto error;
761 bset = isl_basic_set_alloc_space(isl_space_copy(pnt1->dim), 0, 0, 2 * total);
762
763 for (i = 0; i < total; ++i) {
764 isl_int_mul(t, pnt1->vec->el[1 + i], pnt2->vec->el[0]);
765 isl_int_submul(t, pnt2->vec->el[1 + i], pnt1->vec->el[0]);
766
768 if (k < 0)
769 goto error;
770 isl_seq_clr(bset->ineq[k] + 1, total);
771 if (isl_int_is_pos(t)) {
772 isl_int_set_si(bset->ineq[k][1 + i], -1);
773 isl_int_set(bset->ineq[k][0], pnt1->vec->el[1 + i]);
774 } else {
775 isl_int_set_si(bset->ineq[k][1 + i], 1);
776 isl_int_neg(bset->ineq[k][0], pnt1->vec->el[1 + i]);
777 }
778 isl_int_fdiv_q(bset->ineq[k][0], bset->ineq[k][0], pnt1->vec->el[0]);
779
781 if (k < 0)
782 goto error;
783 isl_seq_clr(bset->ineq[k] + 1, total);
784 if (isl_int_is_pos(t)) {
785 isl_int_set_si(bset->ineq[k][1 + i], 1);
786 isl_int_neg(bset->ineq[k][0], pnt2->vec->el[1 + i]);
787 } else {
788 isl_int_set_si(bset->ineq[k][1 + i], -1);
789 isl_int_set(bset->ineq[k][0], pnt2->vec->el[1 + i]);
790 }
791 isl_int_fdiv_q(bset->ineq[k][0], bset->ineq[k][0], pnt2->vec->el[0]);
792 }
793
794 bset = isl_basic_set_finalize(bset);
795
796 isl_point_free(pnt1);
797 isl_point_free(pnt2);
798
800
801 return bset;
802error:
803 isl_point_free(pnt1);
804 isl_point_free(pnt2);
806 isl_basic_set_free(bset);
807 return NULL;
808}
809
811 __isl_take isl_point *pnt2)
812{
813 isl_basic_set *bset;
814 bset = isl_basic_set_box_from_points(pnt1, pnt2);
815 return isl_set_from_basic_set(bset);
816}
817
818/* Print the coordinate at position "pos" of the point "pnt".
819 */
821 struct isl_print_space_data *data, unsigned pos)
822{
823 isl_point *pnt = data->user;
824
825 pos += isl_space_offset(data->space, data->type);
826 p = isl_printer_print_isl_int(p, pnt->vec->el[1 + pos]);
827 if (!isl_int_is_one(pnt->vec->el[0])) {
828 p = isl_printer_print_str(p, "/");
829 p = isl_printer_print_isl_int(p, pnt->vec->el[0]);
830 }
831
832 return p;
833}
834
837{
838 struct isl_print_space_data data = { 0 };
839 int i;
840 isl_size nparam;
841
842 if (!pnt)
843 return p;
844 if (isl_point_is_void(pnt)) {
845 p = isl_printer_print_str(p, "void");
846 return p;
847 }
848
849 nparam = isl_point_dim(pnt, isl_dim_param);
850 if (nparam < 0)
851 return isl_printer_free(p);
852 if (nparam > 0) {
853 p = isl_printer_print_str(p, "[");
854 for (i = 0; i < nparam; ++i) {
855 const char *name;
856 if (i)
857 p = isl_printer_print_str(p, ", ");
859 if (name) {
861 p = isl_printer_print_str(p, " = ");
862 }
863 p = isl_printer_print_isl_int(p, pnt->vec->el[1 + i]);
864 if (!isl_int_is_one(pnt->vec->el[0])) {
865 p = isl_printer_print_str(p, "/");
866 p = isl_printer_print_isl_int(p, pnt->vec->el[0]);
867 }
868 }
869 p = isl_printer_print_str(p, "]");
870 p = isl_printer_print_str(p, " -> ");
871 }
873 data.user = pnt;
874 p = isl_printer_print_str(p, "{ ");
875 p = isl_print_space(pnt->dim, p, 0, &data);
876 p = isl_printer_print_str(p, " }");
877 return p;
878}
#define __isl_take
Definition: ctx.h:22
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:97
#define __isl_null
Definition: ctx.h:28
#define isl_die(ctx, errno, msg, code)
Definition: ctx.h:137
#define isl_assert(ctx, test, code)
Definition: ctx.h:152
isl_bool isl_bool_ok(int b)
Definition: isl_ctx.c:46
@ isl_error_invalid
Definition: ctx.h:80
#define __isl_keep
Definition: ctx.h:25
int isl_size
Definition: ctx.h:96
#define isl_alloc_type(ctx, type)
Definition: ctx.h:128
isl_bool
Definition: ctx.h:89
@ isl_bool_false
Definition: ctx.h:91
@ isl_bool_error
Definition: ctx.h:90
__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
#define isl_int_is_one(i)
Definition: isl_int.h:32
#define isl_int_is_pos(i)
Definition: isl_int.h:34
__isl_give isl_printer * isl_printer_print_isl_int(__isl_take isl_printer *p, isl_int i)
Definition: isl_printer.c:649
#define isl_int_neg(r, i)
Definition: isl_int_gmp.h:24
#define isl_int_add_ui(r, i, j)
Definition: isl_int_gmp.h:27
#define isl_int_eq(i, j)
Definition: isl_int_gmp.h:57
#define isl_int_set(r, i)
Definition: isl_int_gmp.h:14
#define isl_int_mul(r, i, j)
Definition: isl_int_gmp.h:32
#define isl_int_set_si(r, i)
Definition: isl_int_gmp.h:15
#define isl_int_sub_ui(r, i, j)
Definition: isl_int_gmp.h:28
#define isl_int_fdiv_q(r, i, j)
Definition: isl_int_gmp.h:49
#define isl_int_init(i)
Definition: isl_int_gmp.h:11
#define isl_int_clear(i)
Definition: isl_int_gmp.h:12
#define isl_int_submul(r, i, j)
Definition: isl_int_gmp.h:39
__isl_give isl_vec * isl_local_extend_point_vec(__isl_keep isl_local *local, __isl_take isl_vec *v)
Definition: isl_local.c:329
__isl_give isl_local * isl_local_alloc_from_mat(__isl_take isl_mat *mat)
Definition: isl_local.c:37
__isl_null isl_local * isl_local_free(__isl_take isl_local *local)
Definition: isl_local.c:51
__isl_give isl_basic_set * isl_basic_set_alloc_space(__isl_take isl_space *space, unsigned extra, unsigned n_eq, unsigned n_ineq)
Definition: isl_map.c:1361
__isl_give isl_set * isl_set_cow(__isl_take isl_set *set)
Definition: isl_map.c:2082
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_map.c:70
__isl_give isl_mat * isl_basic_map_get_divs(__isl_keep isl_basic_map *bmap)
Definition: isl_map.c:480
isl_bool isl_basic_map_contains(__isl_keep isl_basic_map *bmap, __isl_keep isl_vec *vec)
Definition: isl_map.c:3661
__isl_give isl_basic_set * isl_basic_set_from_underlying_set(__isl_take isl_basic_set *bset, __isl_take isl_basic_set *like)
Definition: isl_map.c:5750
int isl_basic_set_alloc_inequality(__isl_keep isl_basic_set *bset)
Definition: isl_map.c:1761
__isl_give isl_basic_set * isl_basic_set_finalize(__isl_take isl_basic_set *bset)
__isl_give isl_printer * isl_print_space(__isl_keep isl_space *space, __isl_take isl_printer *p, int rational, struct isl_print_space_data *data)
Definition: isl_output.c:462
static isl_size isl_point_var_offset(__isl_keep isl_point *pnt, enum isl_dim_type type)
Definition: isl_point.c:307
__isl_give isl_point * isl_point_alloc(__isl_take isl_space *space, __isl_take isl_vec *vec)
Definition: isl_point.c:66
__isl_give isl_vec * isl_point_take_vec(__isl_keep isl_point *pnt)
Definition: isl_point.c:254
__isl_give isl_space * isl_point_get_space(__isl_keep isl_point *pnt)
Definition: isl_point.c:44
static isl_stat foreach_point(struct isl_scan_callback *cb, __isl_take isl_vec *sample)
Definition: isl_point.c:565
__isl_give isl_space * isl_point_take_space(__isl_keep isl_point *pnt)
Definition: isl_point.c:189
isl_bool isl_point_is_void(__isl_keep isl_point *pnt)
Definition: isl_point.c:172
static __isl_give isl_point * isl_point_reorder(__isl_take isl_point *pnt, __isl_take isl_reordering *r)
Definition: isl_point.c:315
__isl_give isl_point * isl_point_align_params(__isl_take isl_point *pnt, __isl_take isl_space *model)
Definition: isl_point.c:336
__isl_give isl_set * isl_point_to_set(__isl_take isl_point *pnt)
Definition: isl_point.c:700
__isl_give isl_set * isl_set_box_from_points(__isl_take isl_point *pnt1, __isl_take isl_point *pnt2)
Definition: isl_point.c:810
__isl_give isl_point * isl_point_copy(__isl_keep isl_point *pnt)
Definition: isl_point.c:141
isl_bool isl_set_contains_point(__isl_keep isl_set *set, __isl_keep isl_point *point)
Definition: isl_point.c:668
__isl_keep isl_space * isl_point_peek_space(__isl_keep isl_point *pnt)
Definition: isl_point.c:39
static isl_size isl_point_dim(__isl_keep isl_point *pnt, enum isl_dim_type type)
Definition: isl_point.c:299
__isl_keep isl_vec * isl_point_peek_vec(__isl_keep isl_point *pnt)
Definition: isl_point.c:233
__isl_give isl_vec * isl_point_get_vec(__isl_keep isl_point *pnt)
Definition: isl_point.c:240
__isl_null isl_point * isl_point_free(__isl_take isl_point *pnt)
Definition: isl_point.c:150
__isl_give isl_point * isl_point_zero(__isl_take isl_space *space)
Definition: isl_point.c:98
__isl_give isl_point * isl_point_add_ui(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, unsigned val)
Definition: isl_point.c:502
__isl_give isl_union_set * isl_union_set_from_point(__isl_take isl_point *pnt)
Definition: isl_point.c:708
static __isl_give isl_printer * print_coordinate(__isl_take isl_printer *p, struct isl_print_space_data *data, unsigned pos)
Definition: isl_point.c:820
__isl_give isl_point * isl_point_sub_ui(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, unsigned val)
Definition: isl_point.c:530
__isl_give isl_point * isl_point_set_coordinate_val(__isl_take isl_point *pnt, enum isl_dim_type type, int pos, __isl_take isl_val *v)
Definition: isl_point.c:452
__isl_give isl_printer * isl_printer_print_point(__isl_take isl_printer *p, __isl_keep isl_point *pnt)
Definition: isl_point.c:835
static __isl_give isl_val * isl_point_get_coordinate_val(__isl_keep isl_point *pnt, enum isl_dim_type type, int pos)
Definition: isl_point.c:374
__isl_give isl_multi_val * isl_point_get_multi_val(__isl_keep isl_point *pnt)
Definition: isl_point.c:423
__isl_give isl_basic_set * isl_basic_set_box_from_points(__isl_take isl_point *pnt1, __isl_take isl_point *pnt2)
Definition: isl_point.c:723
static __isl_give isl_multi_val * set_nan(__isl_take isl_multi_val *mv)
Definition: isl_point.c:403
isl_ctx * isl_point_get_ctx(__isl_keep isl_point *pnt)
Definition: isl_point.c:32
__isl_give isl_point * isl_point_restore_vec(__isl_take isl_point *pnt, __isl_take isl_vec *vec)
Definition: isl_point.c:273
__isl_give isl_point * isl_point_restore_space(__isl_take isl_point *pnt, __isl_take isl_space *space)
Definition: isl_point.c:207
isl_bool isl_basic_map_contains_point(__isl_keep isl_basic_map *bmap, __isl_keep isl_point *point)
Definition: isl_point.c:616
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:576
__isl_give isl_set * isl_set_from_point(__isl_take isl_point *pnt)
Definition: isl_point.c:690
__isl_give isl_point * isl_point_void(__isl_take isl_space *space)
Definition: isl_point.c:164
__isl_give isl_point * isl_point_cow(__isl_take isl_point *pnt)
Definition: isl_point.c:127
isl_bool isl_map_contains_point(__isl_keep isl_map *map, __isl_keep isl_point *point)
Definition: isl_point.c:639
__isl_give isl_point * isl_point_dup(__isl_keep isl_point *pnt)
Definition: isl_point.c:117
__isl_give isl_basic_set * isl_basic_set_from_point(__isl_take isl_point *pnt)
Definition: isl_point.c:674
__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_copy(__isl_keep isl_reordering *exp)
__isl_give isl_basic_set * isl_basic_set_from_vec(__isl_take isl_vec *vec)
Definition: isl_sample.c:1209
isl_stat isl_basic_set_scan(__isl_take isl_basic_set *bset, struct isl_scan_callback *callback)
Definition: isl_scan.c:102
void isl_seq_clr(isl_int *p, unsigned len)
Definition: isl_seq.c:14
void isl_seq_scale(isl_int *dst, isl_int *src, isl_int m, unsigned len)
Definition: isl_seq.c:70
unsigned isl_space_offset(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_space.c:365
enum isl_fold type
Definition: isl_test.c:4017
const char * set
Definition: isl_test.c:1356
const char * map
Definition: isl_test.c:1783
const char * p
Definition: isl_test.c:8643
const char * name
Definition: isl_test.c:10938
const char * point
Definition: isl_test.c:10700
static __isl_give isl_union_map * total(__isl_take isl_union_map *umap, __isl_give isl_map *(*fn)(__isl_take isl_map *))
__isl_give isl_val * isl_val_normalize(__isl_take isl_val *v)
Definition: isl_val.c:385
__isl_give isl_val * isl_val_rat_from_isl_int(isl_ctx *ctx, isl_int n, isl_int d)
Definition: isl_val.c:202
__isl_give isl_vec * isl_vec_cow(__isl_take isl_vec *vec)
Definition: isl_vec.c:220
__isl_give isl_vec * isl_vec_reorder(__isl_take isl_vec *vec, unsigned offset, __isl_take isl_reordering *r)
Definition: isl_vec.c:661
t0 *a *b *t *a *b * t
Definition: jacobi_kernel4.c:2
__isl_give isl_map * isl_map_copy(__isl_keep isl_map *map)
Definition: isl_map.c:1494
__isl_null isl_map * isl_map_free(__isl_take isl_map *map)
Definition: isl_map.c:6421
__isl_give isl_map * isl_map_compute_divs(__isl_take isl_map *map)
Definition: isl_map.c:8086
struct isl_set isl_set
Definition: map_type.h:26
struct isl_basic_set isl_basic_set
Definition: map_type.h:20
__isl_null isl_printer * isl_printer_free(__isl_take isl_printer *printer)
Definition: isl_printer.c:269
__isl_give isl_printer * isl_printer_print_str(__isl_take isl_printer *p, const char *s)
Definition: isl_printer.c:617
__isl_give isl_set * isl_set_make_disjoint(__isl_take isl_set *set)
__isl_export __isl_give isl_space * isl_set_get_space(__isl_keep isl_set *set)
Definition: isl_map.c:603
__isl_null isl_basic_set * isl_basic_set_free(__isl_take isl_basic_set *bset)
Definition: isl_map.c:1523
__isl_null isl_set * isl_set_free(__isl_take isl_set *set)
Definition: isl_map.c:3513
__isl_give isl_set * isl_set_copy(__isl_keep isl_set *set)
Definition: isl_map.c:1470
__isl_give isl_set * isl_set_compute_divs(__isl_take isl_set *set)
Definition: isl_map.c:8124
__isl_give isl_basic_set * isl_basic_set_empty(__isl_take isl_space *space)
Definition: isl_map.c:6275
__isl_constructor __isl_give isl_set * isl_set_from_basic_set(__isl_take isl_basic_set *bset)
Definition: isl_map.c:3482
__isl_give isl_basic_set * isl_basic_set_copy(__isl_keep isl_basic_set *bset)
Definition: isl_map.c:1465
isl_bool isl_space_has_equal_params(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition: isl_space.c:1140
__isl_null isl_space * isl_space_free(__isl_take isl_space *space)
Definition: isl_space.c:445
isl_ctx * isl_space_get_ctx(__isl_keep isl_space *space)
Definition: isl_space.c:23
__isl_give isl_space * isl_space_copy(__isl_keep isl_space *space)
Definition: isl_space.c:436
__isl_keep const char * isl_space_get_dim_name(__isl_keep isl_space *space, enum isl_dim_type type, unsigned pos)
Definition: isl_space.c:863
__isl_export isl_bool isl_space_is_equal(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
Definition: isl_space.c:2511
isl_size isl_space_dim(__isl_keep isl_space *space, enum isl_dim_type type)
Definition: isl_space.c:340
isl_dim_type
Definition: space_type.h:13
@ isl_dim_param
Definition: space_type.h:15
@ isl_dim_set
Definition: space_type.h:18
@ isl_dim_all
Definition: space_type.h:20
isl_space * dim
Definition: isl_point.c:562
isl_stat(* fn)(__isl_take isl_point *pnt, void *user)
Definition: isl_point.c:560
struct isl_scan_callback callback
Definition: isl_point.c:559
struct isl_vec * vec
isl_space * dim
enum isl_dim_type type
__isl_give isl_printer *(* print_dim)(__isl_take isl_printer *p, struct isl_print_space_data *data, unsigned pos)
unsigned src_len
unsigned dst_len
isl_int * el
unsigned size
static Signature set_to_map
static bool contains(const std::vector< std::string > &v, const std::string &el)
struct isl_union_set isl_union_set
__isl_give isl_union_set * isl_union_set_empty(__isl_take isl_space *space)
__isl_constructor __isl_give isl_union_set * isl_union_set_from_set(__isl_take isl_set *set)
__isl_give isl_val * isl_val_copy(__isl_keep isl_val *v)
Definition: isl_val.c:219
__isl_export __isl_give isl_val * isl_val_nan(isl_ctx *ctx)
Definition: isl_val.c:62
__isl_null isl_val * isl_val_free(__isl_take isl_val *v)
Definition: isl_val.c:263
__isl_export isl_bool isl_val_is_rat(__isl_keep isl_val *v)
Definition: isl_val.c:1151
struct isl_multi_val isl_multi_val
Definition: val_type.h:16
__isl_null isl_vec * isl_vec_free(__isl_take isl_vec *vec)
Definition: isl_vec.c:234
__isl_give isl_vec * isl_vec_copy(__isl_keep isl_vec *vec)
Definition: isl_vec.c:198
__isl_give isl_vec * isl_vec_normalize(__isl_take isl_vec *vec)
Definition: isl_vec.c:456
__isl_give isl_vec * isl_vec_alloc(isl_ctx *ctx, unsigned size)
Definition: isl_vec.c:33
n
Definition: youcefn.c:8