How to reverse the wrapped relation in isl_union_pw_qpolynomial

23 views
Skip to first unread message

Kelvin Yang

unread,
Feb 13, 2023, 7:44:49 AM2/13/23
to isl Development
I want to reverse the wrapped relation in the isl_union_pw_qpolynomial.
For example, I have a isl_union_pw_qpolynomial: {[A[i0, i1] -> B[i2, i3, i4, i5]] -> 1 : i1 = 1 and i2 = 0 and i3 = 0 and i4 = 0 and 0 <= i0 <= 1 and i0 < i5 <= 2 + i0 }.
How can I get {[B[i2, i3, i4, i5] -> A[i0, i1]] -> 1 : i1 = 1 and i2 = 0 and i3 = 0 and i4 = 0 and 0 <= i0 <= 1 and i0 < i5 <= 2 + i0 }?
Thank you!

Kelvin

Sven Verdoolaege

unread,
Feb 13, 2023, 5:44:19 PM2/13/23
to Kelvin Yang, isl Development
It doesn't look like that's available for isl_union_pw_qpolynomial
at the moment. Even for an isl_union_pw_aff, it's not entirely trivial,
but it is possible (illustrated using the Python interface):

>>> a=isl.union_pw_aff("{[A[i0, i1] -> B[i2, i3,i4, i5]] -> [1] : i1 = 1 and i2 = 0 and i3 = 0 and i4 = 0 and 0 <= i0 <= 1and i0 < i5 <= 2 + i0 }")
>>> a.pullback(a.domain().unwrap().reverse().wrap().identity().range_reverse().as_union_pw_multi_aff())
isl.union_pw_aff("{ [B[i2, i3, i4, i5] -> A[i0, i1]] -> [(1)] : i2 = 0 and i3 = 0 and i4 = 0 and i1 = 1 and i0 >= -2 + i5 and 0 <= i0 <= 1 and i0 < i5 }")

I'll see if I can add some more functionality, but it may take a while.

skimo

Kelvin Yang

unread,
Feb 13, 2023, 8:47:17 PM2/13/23
to isl Development
Thank you! It would be great if you could add this new functionality.

Kelvin
Sven Verdoolaege 在 2023年2月14日 星期二清晨6:44:19 [UTC+8] 的信中寫道:

Sven Verdoolaege

unread,
Feb 26, 2023, 4:36:30 AM2/26/23
to Kelvin Yang, isl Development
On Mon, Feb 13, 2023 at 05:47:17PM -0800, Kelvin Yang wrote:
> Thank you! It would be great if you could add this new functionality.

Try isl_union_pw_qpolynomial_domain_reverse

skimo

Kelvin Yang

unread,
Mar 3, 2023, 4:04:13 AM3/3/23
to isl Development
Thank you very much for adding this functionality! I will try it.

Kelvin

Sven Verdoolaege 在 2023年2月26日 星期日下午5:36:30 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages