Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aff get_coefficients_by_name intended behavior? #24

Open
thisiscam opened this issue Mar 3, 2020 · 3 comments
Open

Aff get_coefficients_by_name intended behavior? #24

thisiscam opened this issue Mar 3, 2020 · 3 comments

Comments

@thisiscam
Copy link
Contributor

import islpy
aff = islpy.Aff("[N] -> { [x] -> [x+1] } ")
aff.get_coefficients_by_name(dimtype=None)

gives

isl_aff.c:763: output/set dimension does not have a coefficient

According the doc, setting dimtype to None should produce the coefficients for all dimensions?
I digged a little, in the generated _isl.py,

_CHECK_DIM_TYPES = [
        dim_type.in_, dim_type.param, dim_type.set]

which is used by obj_get_coefficients_by_name to retrieve the coefficients. When does Aff has a set dimension? Is this a bug or intended behavior?

@thisiscam
Copy link
Contributor Author

Btw, to the maintainer of this repo: I have no intention to flood this repo's issues (I felt guilty for the fact that the most recent issues were all opened by me). islpy is a wonderful library! I really appreciate the effort put into this interface, and just hope that some of my nitpicks can help in its development. Thanks for the work!

@inducer
Copy link
Owner

inducer commented Mar 3, 2020

>>> import islpy
>>> aff = islpy.Aff("[N] -> { [x] -> [x+1] } ")
>>> aff.get_dim_name(islpy.dim_type.param, 0)
'N'
>>> aff.get_dim_name(islpy.dim_type.in_, 0)
'x'
>>> 

I'd be OK special-casing Aff in get_coefficients_by_name(None) to avoid triggering the issue. Asking about the "out" dimension of an Aff doesn't make much sense IMO.

@inducer
Copy link
Owner

inducer commented Mar 3, 2020

Also, no worries about opening multiple issues in quick succession. It's good to know someone is finding this useful. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants