Hi there,
I have a vector (more generally: a list) of functions the map a vector to a vector and also a matrix where each row is to be populated by each of the functions. See below an example:
function test()
f_vec = [x -> x.^2 .+ i for i in 1:10]
grid = collect(1:12)
cont = zeros(length(f_vec), length(grid))
for f_ind in 1:length(f_vec)
cont[f_ind, :] .= f_vec[f_ind](grid)
end
end
I get the following benchmarking results:
Which not seem ideal. Is there an optimal way of doing so?
Thanks a lot in advance!