2 * Copyright 2010 INRIA Saclay
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
11 #include <isl_pw_macro.h>
13 static isl_stat
foreach_lifted_subset(__isl_take isl_set
*set
,
15 isl_stat (*fn
)(__isl_take isl_set
*set
, __isl_take EL
*el
,
16 void *user
), void *user
)
23 for (i
= 0; i
< set
->n
; ++i
) {
27 lift
= isl_set_from_basic_set(isl_basic_set_copy(set
->p
[i
]));
28 lift
= isl_set_lift(lift
);
30 copy
= FN(EL
,copy
)(el
);
31 copy
= FN(EL
,lift
)(copy
, isl_set_get_space(lift
));
33 if (fn(lift
, copy
, user
) < 0)
44 return isl_stat_error
;
47 isl_stat
FN(PW
,foreach_lifted_piece
)(__isl_keep PW
*pw
,
48 isl_stat (*fn
)(__isl_take isl_set
*set
, __isl_take EL
*el
,
49 void *user
), void *user
)
54 return isl_stat_error
;
56 for (i
= 0; i
< pw
->n
; ++i
) {
61 any
= isl_set_involves_locals(pw
->p
[i
].set
);
63 return isl_stat_error
;
64 set
= isl_set_copy(pw
->p
[i
].set
);
65 el
= FN(EL
,copy
)(pw
->p
[i
].FIELD
);
67 if (fn(set
, el
, user
) < 0)
68 return isl_stat_error
;
71 if (foreach_lifted_subset(set
, el
, fn
, user
) < 0)
72 return isl_stat_error
;