-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
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];
}
}
Metadata
Metadata
Assignees
Labels
No labels