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

◆ map()

template<typename F , typename T , typename... Args, require_std_vector_t< T > * = nullptr>
auto stan::math::map ( F &&  f,
T &&  x,
Args &&...  args 
)
inline

Return a std::vector whose i-th element is f(x[i], args...).

Additional arguments are shared across calls. If x is empty, the result is empty. The element type of the result is deduced from f.

Template Parameters
Ftype of functor
Ttype of input std::vector
Argstypes of shared arguments
Parameters
[in]ffunctor applied to each element
[in]xinput std::vector
[in]argsshared arguments passed to each call
Returns
std::vector of results

Definition at line 37 of file map.hpp.