I have been wrapping my head about a question it may look simple to you. I want compile a function that depends on a number of undetermined variables as,
Compile[{{x, _Real}, {y, _Real}, {z, _Real}, {w,_Real},...}, Evaluate[f(x,y,z,w,..,)],
RuntimeAttributes -> {Listable}, RuntimeOptions -> "Speed",
Parallelization -> True]
Where {x,y,z,...} can be as long as needed. I have tried the simple exercise of doing,
var={x,y,z}
list=Table[{var[[i]], _Re},{i,Length@var}];
Compile[list, Evaluate[f(x,y,z,w,..,)], RuntimeAttributes -> {Listable}, RuntimeOptions -> "Speed", Parallelization -> True]
but it does not seem to work since _Re needs to be symbolic? (I am asking but I do not know).
Thanks for your comprehension!
UPDATE:
I found a solution thanks to: Evaluating arguments of module (inside compile)
This is what it worked for me:
Compile[Evaluate@({#, _Real} & /@ var), Evaluate[f(x,y,z,w,..,)], RuntimeAttributes -> {Listable}, RuntimeOptions -> "Speed", Parallelization -> True]