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

Decode3 Outer Loop #6

Open
t-wy opened this issue Jul 14, 2022 · 0 comments
Open

Decode3 Outer Loop #6

t-wy opened this issue Jul 14, 2022 · 0 comments

Comments

@t-wy
Copy link

t-wy commented Jul 14, 2022

for (unsigned int i = 0; i<a; i++) {
    for (unsigned int j = 0, k = c, l = c - 1; j<b&&k<d; j++, l--) {
        block[k++] = listFloat[value3[i] - value[l]] * block[l];
    }
}

As k starts from c counting forwards, and l starts from c - 1 counting backwards, they do not overlap.
So is it true that it is equivalent to setting i as only a - 1?

for (unsigned int j = 0, k = c, l = c - 1; j<b&&k<d; j++, l--) {
    block[k++] = listFloat[value3[a - 1] - value[l]] * block[l];
}

P.S. According to Deretore's Code Referencing this source, k and l are initialized in the outmost part instead, so the result should be different.

unsigned int k = c;
unsigned int l = c - 1;
for (unsigned int i = 0; i < a; i++) {
    for (unsigned int j = 0; j < b && k < d; j++, l--) {
        block[k++] = listFloat[value3[i] - value[l]] * block[l];
    }
}

From another source, it is

for (uint32 i = 0, k = c, l = c - 1; i < a; i++) {
    for (uint32 j = 0; j < b && k < d; j++, l--) {
        block[k++] = listFloat[value3[i] - value[l]] * block[l];
    }
}
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

1 participant