Hello,
Context: I would like to do a d-dimensional midlepoint integration with d as an input parameter. This leads to the problem that I need to make a d-loop
for i_1 in eachindex(x_1)
for i_2 in eachindex(x_2)
...
for i_d in eachindex(x_3)
...
end
end
...
end
which I have no idea how to perform.
The other possibility is to make an array of the d-length vectors. However, I do not know how to obtain such structure from x_1, …, x_d, either. What should be the best way to go through all n_1*…*n_d points?
Thank you in advance!
P.S. Also, I need to make it as straightforward as possible since one part of exercise is to compare the performance with MC integration for different d. Hence, no tricks to avoid loops are needed I think.