Hi!
I have a function which takes two 2-element Array{Float64,1} as input. An example (mine is much more complicated, but can’t be shared sadly). It can look something like this.
function Example(x,y)
return norm(x.-y)
end
Imagine now that I have two Nx2-element Array{Float64,2} xv
and yv
, where N is a large number. Of course, with a for loop and slices, we can apply Èxample
to each row, by
for i in N
Example(xv[i,:],yv[i,:])
end
I want to do this fast and I want to avoid slices since I want to use ForwardDiff later on. I have tried pmap and mapslices with no luck. Any tips?