Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ mapN()

template<typename F , typename Tuple , typename... Args, require_all_tuple_elements_t< is_std_vector, Tuple > * = nullptr>
auto stan::math::mapN ( F &&  f,
Tuple &&  xs,
Args &&...  args 
)
inline

Return a std::vector whose i-th element is f(get<0>(xs)[i], get<1>(xs)[i], ..., args...).

The tuple xs must contain at least two equal-sized std::vector inputs. Additional trailing arguments are shared across calls. If the inputs are empty, the result is empty. The element type of the result is deduced from f.

Template Parameters
Ftype of functor
Tupletype of tuple of std::vector inputs
Argstypes of shared arguments
Parameters
[in]ffunctor applied to each tuple of elements
[in]xstuple of std::vector inputs
[in]argsshared arguments passed to each call
Returns
std::vector of results
Exceptions
std::invalid_argumentif the inputs have different sizes

Definition at line 68 of file map.hpp.