cancel
Showing results for 
Search instead for 
Did you mean: 

how to use threshold 1D array

JÞB
Knight of NI

Re: how to use threshold 1D array

Message contains a hyperlink

@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. Smiley Wink

 

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". Smiley Very Happy


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 exampleSmiley Very Happy


"Should be" isn't "Is" -Jay
Highlighted
altenbach
Knight of NI

Re: how to use threshold 1D array

Message contains an image

 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. Smiley Very Happy)

 

 

thorn.png

 

 


@JÞB wrote:
Why is that negate in the loop?  With debugging off the compiler migrates it anyway but still.  We should set an exampleSmiley Very Happy

 

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)