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

TilePattern::global_at returns wrong offset #667

Open
devreal opened this issue Sep 30, 2019 · 1 comment
Open

TilePattern::global_at returns wrong offset #667

devreal opened this issue Sep 30, 2019 · 1 comment

Comments

@devreal
Copy link
Member

devreal commented Sep 30, 2019

Can someone please shed some light on the following issue? I have a 2D NArray with TilePattern and use global_at to determine the global offsets of elements in the tiles. Consider the following example (numbers are unit IDs):

0 0 | 1 1 | 0 0 | 1 1
0 0 | 1 1 | 0 0 | 1 1
2 2 | 3 3 | 2 2 | 3 3
2 2 | 3 3 | 2 2 | 3 3 

If I try to get the global offsets of the first and last element of the block {0, 0}, I do

// first element in block {0, 0}
pattern.global_at({0, 0}); // returns 0, as expected
// last element in block {0, 0}
pattern.global_at({1, 1}); // returns 3, expected?

The second call to global_at returns 3, which is the offset inside the first block. The documentation of global_at states that it provides Global coordinates to global position in the pattern's iteration order. It is my understanding that the global iteration order is linear through the row and column, unlike the local iteration order. Thus, the second call to global_at should return 9.

Is my understanding of the term global iteration order incorrect or is TilePattern::global_at broken?

@rkowalewski
Copy link

Cannot help you really here because I still do not understand the pattern code. AFAIK you are right with your assumptions.

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