Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • While I completely agree with that, i do not have a dot operation here. In the current method, all I can do is do simple + and - with np.float -> which was 3 times slower than doing it with normal python floats PS: I did have a constraint that numpy/numba wont work as i cant vectorize this math, but @stephen Raunch's first comment made me revert that because I assumed maybe I missed something Commented Sep 19, 2018 at 18:26
  • I réalize that you don't have a dot opération but i didn't have a simpler example. And you are not saying everything because judging from thé code you posted i don't sée why it can't bé vectorize. Post thé code you think can't bé vectorized and we'll discuss it then. Sounds good ? Commented Sep 19, 2018 at 19:25
  • In the above example, the p[i] is being calculated in the last line of the For loop. And p[i-1] is being used in the first line of the For loop. And all the calculations internally do not have a closed form expression as it has mins and max. In such a case, I can never compute the next for-loop because p[i-1] needs the previous for loop to execute. Hence IMO not vectorizable Commented Sep 20, 2018 at 17:03