(no title)
ianhorn | 4 years ago
I believe you've misunderstood the main point of my comment. I don't have too strong opinions about reshape vs newaxis.
The real point was about excessive inlining, which your update does not to fix. A fairer comparison regarding readability would be pulling out the matrix version of a into a named variable:
n = len(a)
A = a.reshape(n,1)
M = exp(1j * k * sqrt(A**2 + A.T**2))
I believe these are much much more readable.When you need loops, you need loops, of course, and python tends to suck here (though with jax's functional programming constructs the boundary is shifting). But the readability/cleanliness comparison in your post is still an unfair comparison.
No comments yet.