08-08-2018 04:18 PM - edited 08-08-2018 04:34 PM
@altenbach wrote:
@Ben wrote:
Stephen (AQ unless I spell his name wrong. Brain does not allow me to store correct spellings).
OK, I thought you were quoting somebody from this thread. 😉
Yes, for certain operations the compiler just flags that the array is reversed without making a new copy, but it is not clear if threshold array understands that flag (doubt it) or always expects a plain array. And we still have the problem that the returned fractional index is different from the index we want, i.e. the positions in the non-reversed array. I would go with "negate". 😄
Isn't that what I said 2 hrs earlier! For the same drafted reasons? Nice too see you debating the point.
And yes, since threshold array has an override for array of points where points are clusters ( numerical , the brown kind) it is unclear whether or not the array can safely reverse in place. Much safer to alwaysnegate rather than suffer the consequences of using the reverse technique and adapting the same when points get used. Consistantly use of negate yields consistantly behavior. Better still x-1. So you treat points x-1,1
Why is that negate in the loop? With debugging off the compiler migrates it anyway but still. We should set an example:D
08-08-2018 04:33 PM - edited 08-08-2018 04:37 PM
wrote:
Isn't that what I said 2 hrs earlier! For the same drafted reasons? Nice too see you debating the point.
(sorry, I only saw your post content below the quoted parts and missed the sentence above it, possibly because it was not clearly separated from the quote, e.g. by some whitespace and all bunched together. :D)
@JÞB wrote:
Why is that negate in the loop? With debugging off the compiler migrates it anyway but still. We should set an example:D
Only one of my negate is in the loop for a more general solution, for example if the data to be processed is acquired inside the loop or if it is the result of some other lengthy computation inside the loop. (... and yes, the compiler will move it out as loop invariant code here, of course, so no difference)