Lines Matching refs:FN

5 #define FN(TYPE,NAME) xFN(TYPE,NAME)
10 __isl_give PW *FN(PW,alloc_size)(__isl_take isl_space *dim,
13 __isl_give PW *FN(PW,alloc_size)(__isl_take isl_space *dim, int n)
42 __isl_give PW *FN(PW,ZERO)(__isl_take isl_space *dim, enum isl_fold type)
44 return FN(PW,alloc_size)(dim, type, 0);
47 __isl_give PW *FN(PW,ZERO)(__isl_take isl_space *dim)
49 return FN(PW,alloc_size)(dim, 0);
53 __isl_give PW *FN(PW,add_piece)(__isl_take PW *pw,
62 if (isl_set_plain_is_empty(set) || FN(EL,EL_IS_ZERO)(el)) {
64 FN(EL,free)(el);
74 el_dim = FN(EL,get_space(el));
86 FN(PW,free)(pw);
88 FN(EL,free)(el);
93 __isl_give PW *FN(PW,alloc)(enum isl_fold type,
96 __isl_give PW *FN(PW,alloc)(__isl_take isl_set *set, __isl_take EL *el)
105 pw = FN(PW,alloc_size)(FN(EL,get_space)(el), type, 1);
107 pw = FN(PW,alloc_size)(FN(EL,get_space)(el), 1);
110 return FN(PW,add_piece)(pw, set, el);
113 FN(EL,free)(el);
117 __isl_give PW *FN(PW,dup)(__isl_keep PW *pw)
126 dup = FN(PW,alloc_size)(isl_space_copy(pw->dim), pw->type, pw->n);
128 dup = FN(PW,alloc_size)(isl_space_copy(pw->dim), pw->n);
134 dup = FN(PW,add_piece)(dup, isl_set_copy(pw->p[i].set),
135 FN(EL,copy)(pw->p[i].FIELD));
140 __isl_give PW *FN(PW,cow)(__isl_take PW *pw)
148 return FN(PW,dup)(pw);
151 __isl_give PW *FN(PW,copy)(__isl_keep PW *pw)
160 void *FN(PW,free)(__isl_take PW *pw)
171 FN(EL,free)(pw->p[i].FIELD);
179 const char *FN(PW,get_dim_name)(__isl_keep PW *pw, enum isl_dim_type type,
185 int FN(PW,has_dim_id)(__isl_keep PW *pw, enum isl_dim_type type, unsigned pos)
190 __isl_give isl_id *FN(PW,get_dim_id)(__isl_keep PW *pw, enum isl_dim_type type,
196 int FN(PW,has_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type)
201 const char *FN(PW,get_tuple_name)(__isl_keep PW *pw, enum isl_dim_type type)
206 int FN(PW,has_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type)
211 __isl_give isl_id *FN(PW,get_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type)
216 int FN(PW,IS_ZERO)(__isl_keep PW *pw)
225 __isl_give PW *FN(PW,realign_domain)(__isl_take PW *pw,
230 pw = FN(PW,cow)(pw);
239 pw->p[i].FIELD = FN(EL,realign_domain)(pw->p[i].FIELD,
245 pw = FN(PW,reset_domain_space)(pw, isl_space_copy(exp->dim));
251 FN(PW,free)(pw);
257 __isl_give PW *FN(PW,align_params)(__isl_take PW *pw, __isl_take isl_space *model)
280 FN(PW,get_domain_space)(pw));
281 pw = FN(PW,realign_domain)(pw, exp);
288 FN(PW,free)(pw);
292 static __isl_give PW *FN(PW,align_params_pw_pw_and)(__isl_take PW *pw1,
302 ctx = FN(PW,get_ctx)(pw1);
307 pw1 = FN(PW,align_params)(pw1, FN(PW,get_space)(pw2));
308 pw2 = FN(PW,align_params)(pw2, FN(PW,get_space)(pw1));
311 FN(PW,free)(pw1);
312 FN(PW,free)(pw2);
316 static __isl_give PW *FN(PW,align_params_pw_set_and)(__isl_take PW *pw,
326 ctx = FN(PW,get_ctx)(pw);
331 pw = FN(PW,align_params)(pw, isl_set_get_space(set));
332 set = isl_set_align_params(set, FN(PW,get_space)(pw));
335 FN(PW,free)(pw);
341 static __isl_give PW *FN(PW,union_add_aligned)(__isl_take PW *pw1,
360 if (FN(PW,IS_ZERO)(pw1)) {
361 FN(PW,free)(pw1);
365 if (FN(PW,IS_ZERO)(pw2)) {
366 FN(PW,free)(pw2);
372 res = FN(PW,alloc_size)(isl_space_copy(pw1->dim), pw1->type, n);
374 res = FN(PW,alloc_size)(isl_space_copy(pw1->dim), n);
391 sum = FN(EL,add_on_domain)(common,
392 FN(EL,copy)(pw1->p[i].FIELD),
393 FN(EL,copy)(pw2->p[j].FIELD));
395 res = FN(PW,add_piece)(res, common, sum);
397 res = FN(PW,add_piece)(res, set, FN(EL,copy)(pw1->p[i].FIELD));
405 res = FN(PW,add_piece)(res, set, FN(EL,copy)(pw2->p[j].FIELD));
408 FN(PW,free)(pw1);
409 FN(PW,free)(pw2);
413 FN(PW,free)(pw1);
414 FN(PW,free)(pw2);
421 static __isl_give PW *FN(PW,union_add_)(__isl_take PW *pw1, __isl_take PW *pw2)
423 return FN(PW,align_params_pw_pw_and)(pw1, pw2,
424 &FN(PW,union_add_aligned));
432 static __isl_give PW *FN(PW,grow)(__isl_take PW *pw, int n)
442 ctx = FN(PW,get_ctx)(pw);
448 return FN(PW,free)(pw);
453 res = FN(PW,alloc_size)(isl_space_copy(pw->dim), pw->type, n);
455 res = FN(PW,alloc_size)(isl_space_copy(pw->dim), n);
458 return FN(PW,free)(pw);
460 res = FN(PW,add_piece)(res, isl_set_copy(pw->p[i].set),
461 FN(EL,copy)(pw->p[i].FIELD));
462 FN(PW,free)(pw);
466 static __isl_give PW *FN(PW,add_disjoint_aligned)(__isl_take PW *pw1,
476 return FN(PW,add_disjoint_aligned)(pw2, pw1);
486 if (FN(PW,IS_ZERO)(pw1)) {
487 FN(PW,free)(pw1);
491 if (FN(PW,IS_ZERO)(pw2)) {
492 FN(PW,free)(pw2);
496 pw1 = FN(PW,grow)(pw1, pw2->n);
501 pw1 = FN(PW,add_piece)(pw1,
503 FN(EL,copy)(pw2->p[i].FIELD));
505 FN(PW,free)(pw2);
509 FN(PW,free)(pw1);
510 FN(PW,free)(pw2);
514 __isl_give PW *FN(PW,add_disjoint)(__isl_take PW *pw1, __isl_take PW *pw2)
516 return FN(PW,align_params_pw_pw_and)(pw1, pw2,
517 &FN(PW,add_disjoint_aligned));
522 static __isl_give PW *FN(PW,on_shared_domain_in)(__isl_take PW *pw1,
530 static __isl_give PW *FN(PW,on_shared_domain_in)(__isl_take PW *pw1,
542 res = FN(PW,alloc_size)(isl_space_copy(space), pw1->type, n);
544 res = FN(PW,alloc_size)(isl_space_copy(space), n);
564 res_ij = fn(FN(EL,copy)(pw1->p[i].FIELD),
565 FN(EL,copy)(pw2->p[j].FIELD));
566 res_ij = FN(EL,gist)(res_ij, isl_set_copy(common));
568 res = FN(PW,add_piece)(res, common, res_ij);
573 FN(PW,free)(pw1);
574 FN(PW,free)(pw2);
578 FN(PW,free)(pw1);
579 FN(PW,free)(pw2);
580 FN(PW,free)(res);
586 static __isl_give PW *FN(PW,on_shared_domain)(__isl_take PW *pw1,
594 static __isl_give PW *FN(PW,on_shared_domain)(__isl_take PW *pw1,
604 return FN(PW,on_shared_domain_in)(pw1, pw2, space, fn);
606 FN(PW,free)(pw1);
607 FN(PW,free)(pw2);
612 __isl_give PW *FN(PW,neg)(__isl_take PW *pw)
619 if (FN(PW,IS_ZERO)(pw))
622 pw = FN(PW,cow)(pw);
627 pw->p[i].FIELD = FN(EL,neg)(pw->p[i].FIELD);
629 return FN(PW,free)(pw);
635 __isl_give PW *FN(PW,sub)(__isl_take PW *pw1, __isl_take PW *pw2)
637 return FN(PW,add)(pw1, FN(PW,neg)(pw2));
642 __isl_give isl_qpolynomial *FN(PW,eval)(__isl_take PW *pw,
666 qp = FN(EL,eval)(FN(EL,copy)(pw->p[i].FIELD),
669 qp = isl_qpolynomial_zero_on_domain(FN(PW,get_domain_space)(pw));
670 FN(PW,free)(pw);
675 FN(PW,free)(pw);
682 __isl_give isl_set *FN(PW,domain)(__isl_take PW *pw)
690 dom = isl_set_empty(FN(PW,get_domain_space)(pw));
694 FN(PW,free)(pw);
704 static int FN(PW,exploit_equalities_and_remove_if_empty)(__isl_keep PW *pw,
714 FN(EL,free)(pw->p[i].FIELD);
723 pw->p[i].FIELD = FN(EL,substitute_equalities)(pw->p[i].FIELD, aff);
734 static __isl_give PW *FN(PW,intersect_aligned)(__isl_take PW *pw,
749 pw = FN(PW,cow)(pw);
755 if (FN(PW,exploit_equalities_and_remove_if_empty)(pw, i) < 0)
763 FN(PW,free)(pw);
767 static __isl_give PW *FN(PW,intersect_domain_aligned)(__isl_take PW *pw,
770 return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect);
773 __isl_give PW *FN(PW,intersect_domain)(__isl_take PW *pw,
776 return FN(PW,align_params_pw_set_and)(pw, context,
777 &FN(PW,intersect_domain_aligned));
780 static __isl_give PW *FN(PW,intersect_params_aligned)(__isl_take PW *pw,
783 return FN(PW,intersect_aligned)(pw, set, &isl_set_intersect_params);
788 __isl_give PW *FN(PW,intersect_params)(__isl_take PW *pw,
791 return FN(PW,align_params_pw_set_and)(pw, context,
792 &FN(PW,intersect_params_aligned));
795 static __isl_give PW *FN(PW,gist_aligned)(__isl_take PW *pw,
815 pw = FN(PW,align_params)(pw, isl_set_get_space(context));
816 context = isl_set_align_params(context, FN(PW,get_space)(pw));
822 pw = FN(PW,cow)(pw);
839 FN(EL,free)(pw->p[i].FIELD);
851 FN(PW,free)(pw);
857 static __isl_give PW *FN(PW,gist_domain_aligned)(__isl_take PW *pw,
860 return FN(PW,gist_aligned)(pw, set, &FN(EL,gist),
864 __isl_give PW *FN(PW,gist)(__isl_take PW *pw, __isl_take isl_set *context)
866 return FN(PW,align_params_pw_set_and)(pw, context,
867 &FN(PW,gist_domain_aligned));
870 static __isl_give PW *FN(PW,gist_params_aligned)(__isl_take PW *pw,
873 return FN(PW,gist_aligned)(pw, set, &FN(EL,gist_params),
877 __isl_give PW *FN(PW,gist_params)(__isl_take PW *pw,
880 return FN(PW,align_params_pw_set_and)(pw, context,
881 &FN(PW,gist_params_aligned));
884 __isl_give PW *FN(PW,coalesce)(__isl_take PW *pw)
895 if (!FN(EL,plain_is_equal)(pw->p[i].FIELD,
900 FN(EL,free)(pw->p[i].FIELD);
915 FN(PW,free)(pw);
919 isl_ctx *FN(PW,get_ctx)(__isl_keep PW *pw)
925 int FN(PW,involves_dims)(__isl_keep PW *pw, enum isl_dim_type type,
939 int involves = FN(EL,involves_dims)(pw->p[i].FIELD,
952 __isl_give PW *FN(PW,set_dim_name)(__isl_take PW *pw,
958 pw = FN(PW,cow)(pw);
973 pw->p[i].FIELD = FN(EL,set_dim_name)(pw->p[i].FIELD, type, pos, s);
980 FN(PW,free)(pw);
985 __isl_give PW *FN(PW,drop_dims)(__isl_take PW *pw,
998 pw = FN(PW,cow)(pw);
1005 pw->p[i].FIELD = FN(EL,drop_dims)(pw->p[i].FIELD, type, first, n);
1017 FN(PW,free)(pw);
1026 __isl_give PW *FN(PW,project_out)(__isl_take PW *pw,
1039 pw = FN(PW,cow)(pw);
1050 pw->p[i].FIELD = FN(EL,drop_dims)(pw->p[i].FIELD, type, first, n);
1057 FN(PW,free)(pw);
1063 __isl_give PW *FN(PW,project_domain_on_params)(__isl_take PW *pw)
1068 n = FN(PW,dim)(pw, isl_dim_in);
1069 pw = FN(PW,project_out)(pw, isl_dim_in, 0, n);
1070 space = FN(PW,get_domain_space)(pw);
1072 pw = FN(PW,reset_domain_space)(pw, space);
1078 __isl_give PW *FN(PW,insert_dims)(__isl_take PW *pw, enum isl_dim_type type,
1091 pw = FN(PW,cow)(pw);
1104 pw->p[i].FIELD = FN(EL,insert_dims)(pw->p[i].FIELD,
1112 FN(PW,free)(pw);
1117 __isl_give PW *FN(PW,fix_dim)(__isl_take PW *pw,
1128 pw = FN(PW,cow)(pw);
1133 if (FN(PW,exploit_equalities_and_remove_if_empty)(pw, i) < 0)
1134 return FN(PW,free)(pw);
1143 __isl_give PW *FN(PW,fix_val)(__isl_take PW *pw,
1147 return FN(PW,free)(pw);
1149 isl_die(FN(PW,get_ctx)(pw), isl_error_invalid,
1152 pw = FN(PW,fix_dim)(pw, type, pos, v->n);
1158 return FN(PW,free)(pw);
1161 unsigned FN(PW,dim)(__isl_keep PW *pw, enum isl_dim_type type)
1166 __isl_give PW *FN(PW,split_dims)(__isl_take PW *pw,
1179 pw = FN(PW,cow)(pw);
1192 FN(PW,free)(pw);
1202 __isl_give isl_qpolynomial *FN(PW,opt)(__isl_take PW *pw, int max)
1212 FN(PW,free)(pw);
1216 opt = FN(EL,opt_on_domain)(FN(EL,copy)(pw->p[0].FIELD),
1220 opt_i = FN(EL,opt_on_domain)(FN(EL,copy)(pw->p[i].FIELD),
1228 FN(PW,free)(pw);
1232 __isl_give isl_qpolynomial *FN(PW,max)(__isl_take PW *pw)
1234 return FN(PW,opt)(pw, 1);
1237 __isl_give isl_qpolynomial *FN(PW,min)(__isl_take PW *pw)
1239 return FN(PW,opt)(pw, 0);
1243 __isl_give isl_space *FN(PW,get_space)(__isl_keep PW *pw)
1248 __isl_give isl_space *FN(PW,get_domain_space)(__isl_keep PW *pw)
1258 static __isl_give PW *FN(PW,reset_space_and_domain)(__isl_take PW *pw,
1263 pw = FN(PW,cow)(pw);
1272 pw->p[i].FIELD = FN(EL,reset_space_and_domain)(pw->p[i].FIELD,
1287 FN(PW,free)(pw);
1291 __isl_give PW *FN(PW,reset_domain_space)(__isl_take PW *pw,
1297 FN(PW,get_space)(pw));
1298 return FN(PW,reset_space_and_domain)(pw, space, domain);
1301 __isl_give PW *FN(PW,reset_space)(__isl_take PW *pw, __isl_take isl_space *dim)
1306 return FN(PW,reset_space_and_domain)(pw, dim, domain);
1309 __isl_give PW *FN(PW,set_tuple_id)(__isl_keep PW *pw, enum isl_dim_type type,
1314 pw = FN(PW,cow)(pw);
1318 space = FN(PW,get_space)(pw);
1321 return FN(PW,reset_space)(pw, space);
1324 __isl_give PW *FN(PW,set_dim_id)(__isl_take PW *pw,
1327 pw = FN(PW,cow)(pw);
1331 return FN(PW,reset_space)(pw, isl_space_copy(pw->dim));
1335 int FN(PW,has_equal_space)(__isl_keep PW *pw1, __isl_keep PW *pw2)
1344 __isl_give PW *FN(PW,morph_domain)(__isl_take PW *pw,
1357 pw = FN(PW,cow)(pw);
1369 pw->p[i].FIELD = FN(EL,morph_domain)(pw->p[i].FIELD,
1379 FN(PW,free)(pw);
1385 int FN(PW,n_piece)(__isl_keep PW *pw)
1390 int FN(PW,foreach_piece)(__isl_keep PW *pw,
1401 FN(EL,copy)(pw->p[i].FIELD), user) < 0)
1438 copy = FN(EL,copy)(el);
1439 copy = FN(EL,lift)(copy, isl_set_get_space(lift));
1446 FN(EL,free)(el);
1451 FN(EL,free)(el);
1455 int FN(PW,foreach_lifted_piece)(__isl_keep PW *pw,
1469 el = FN(EL,copy)(pw->p[i].FIELD);
1484 __isl_give PW *FN(PW,move_dims)(__isl_take PW *pw,
1490 pw = FN(PW,cow)(pw);
1499 pw->p[i].FIELD = FN(EL,move_dims)(pw->p[i].FIELD,
1520 FN(PW,free)(pw);
1525 __isl_give PW *FN(PW,mul_isl_int)(__isl_take PW *pw, isl_int v)
1533 isl_space *dim = FN(PW,get_space)(pw);
1535 zero = FN(PW,ZERO)(dim, pw->type);
1537 zero = FN(PW,ZERO)(dim);
1539 FN(PW,free)(pw);
1542 pw = FN(PW,cow)(pw);
1553 pw->p[i].FIELD = FN(EL,scale)(pw->p[i].FIELD, v);
1560 FN(PW,free)(pw);
1566 __isl_give PW *FN(PW,scale_val)(__isl_take PW *pw, __isl_take isl_val *v)
1579 isl_space *space = FN(PW,get_space)(pw);
1581 zero = FN(PW,ZERO)(space, pw->type);
1583 zero = FN(PW,ZERO)(space);
1585 FN(PW,free)(pw);
1593 pw = FN(PW,cow)(pw);
1602 pw->p[i].FIELD = FN(EL,scale_val)(pw->p[i].FIELD,
1612 FN(PW,free)(pw);
1616 __isl_give PW *FN(PW,scale)(__isl_take PW *pw, isl_int v)
1618 return FN(PW,mul_isl_int)(pw, v);
1621 static int FN(PW,qsort_set_cmp)(const void *p1, const void *p2)
1633 __isl_give PW *FN(PW,normalize)(__isl_take PW *pw)
1643 return FN(PW,free)(pw);
1647 qsort(pw->p, pw->n, sizeof(pw->p[0]), &FN(PW,qsort_set_cmp));
1651 if (!FN(EL,plain_is_equal)(pw->p[i - 1].FIELD, pw->p[i].FIELD))
1656 return FN(PW,free)(pw);
1658 FN(EL,free)(pw->p[i].FIELD);
1673 int FN(PW,plain_is_equal)(__isl_keep PW *pw1, __isl_keep PW *pw2)
1686 pw1 = FN(PW,copy)(pw1);
1687 pw2 = FN(PW,copy)(pw2);
1688 pw1 = FN(PW,normalize)(pw1);
1689 pw2 = FN(PW,normalize)(pw2);
1700 equal = FN(EL,plain_is_equal)(pw1->p[i].FIELD, pw2->p[i].FIELD);
1705 FN(PW,free)(pw1);
1706 FN(PW,free)(pw2);
1709 FN(PW,free)(pw1);
1710 FN(PW,free)(pw2);
1715 static __isl_give PW *FN(PW,align_params_pw_multi_aff_and)(__isl_take PW *pw,
1729 ctx = FN(PW,get_ctx)(pw);
1734 pw = FN(PW,align_params)(pw, ma_space);
1735 ma = isl_multi_aff_align_params(ma, FN(PW,get_space)(pw));
1739 FN(PW,free)(pw);
1744 static __isl_give PW *FN(PW,align_params_pw_pw_multi_aff_and)(__isl_take PW *pw,
1759 ctx = FN(PW,get_ctx)(pw);
1764 pw = FN(PW,align_params)(pw, pma_space);
1765 pma = isl_pw_multi_aff_align_params(pma, FN(PW,get_space)(pw));
1769 FN(PW,free)(pw);
1777 static __isl_give PW *FN(PW,pullback_multi_aff_aligned)(__isl_take PW *pw,
1784 pw = FN(PW,cow)(pw);
1789 FN(PW,get_space)(pw));
1796 pw->p[i].FIELD = FN(EL,pullback_multi_aff)(pw->p[i].FIELD,
1802 pw = FN(PW,reset_space)(pw, space);
1808 FN(PW,free)(pw);
1812 __isl_give PW *FN(PW,pullback_multi_aff)(__isl_take PW *pw,
1815 return FN(PW,align_params_pw_multi_aff_and)(pw, ma,
1816 &FN(PW,pullback_multi_aff_aligned));
1822 static __isl_give PW *FN(PW,pullback_pw_multi_aff_aligned)(__isl_take PW *pw,
1834 FN(PW,get_space)(pw));
1836 res = FN(PW,empty)(space);
1837 FN(PW,free)(pw);
1841 res = FN(PW,pullback_multi_aff)(FN(PW,copy)(pw),
1843 res = FN(PW,intersect_domain)(res, isl_set_copy(pma->p[0].set));
1848 res_i = FN(PW,pullback_multi_aff)(FN(PW,copy)(pw),
1850 res_i = FN(PW,intersect_domain)(res_i,
1852 res = FN(PW,add_disjoint)(res, res_i);
1856 FN(PW,free)(pw);
1860 FN(PW,free)(pw);
1864 __isl_give PW *FN(PW,pullback_pw_multi_aff)(__isl_take PW *pw,
1867 return FN(PW,align_params_pw_pw_multi_aff_and)(pw, pma,
1868 &FN(PW,pullback_pw_multi_aff_aligned));