Hello, I am beginning to use Julia and I want to ask for help doing something efficiently.
I am trying to compute a summation in Julia using the following loop.
for (k_j,kk) = enumerate(k) value=0 for (s_j,ss) = enumerate(s), (z_j,zz) = enumerate(z), (w_j,ww) = enumerate(w) value=value+V₀[w_j,z_j,k_j,s_j]*H[s_i,s_j]*mat[w_j,w_i,z_j,z_i]*G[z_i,z_j] end end
Which is basically calling over specific entries of matrices and adding them up. I’ve tried to make this faster and leaner with a reduce or mapreduce, but haven’t been able to get the code off the ground.
Any suggestion is appreciated, Thanks