Hi!
@bbbales2 what do you think about the map
function I proposed on the other PR with this signature:
return_t mapped_function(int i, elem_t element_i, args...);
std::vector<return_t> map(mapped_function, std::vector<elem_t> large_container, args...);
I have started to look more into brms and it dawns on me that brms stuff would benefit a lot from a map
facility. So what do you think of this signature? Are your tuple utilities matured to some extent such I can use these? Should I branch off the ODE tuple prototype to code this up in a first go or any other suggestions?
I am relatively sure that the building blocks we have in place should allow for a map
which is more handy to have in a few situations. The key to make it efficient is to have the mapped large_container
be an array of an arbitrary data structure with any complexity. This way there do not need to be many shared arguments which are costly as they get copied quite a bit.
BTW, just to make sure, we are right now waiting for parser gurus to add reduce_sum
to the stanc3 world, right?
Sebastian