Stan Math Library
4.8.1
Automatic Differentiation
|
Specialization for use with (non-nested) std::vectors.
Inputs are mapped to Eigen column vectors and then the result is evaluated directly into the returned std::vector (via Eigen::Map).
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
Definition at line 107 of file apply_vector_unary.hpp.
#include <apply_vector_unary.hpp>
Public Types | |
using | T_vt = value_type_t< T > |
using | T_map = typename Eigen::Map< const Eigen::Matrix< T_vt, -1, 1 > > |
Static Public Member Functions | |
template<typename F > | |
static auto | apply (const T &x, const F &f) |
Member function for applying a functor to a vector and subsequently returning a vector. | |
template<typename F > | |
static auto | apply_no_holder (const T &x, const F &f) |
Member function for applying a functor to each container in an std::vector and subsequently returning an std::vector of containers. | |
template<typename F > | |
static auto | reduce (const T &x, const F &f) |
Member function for applying a functor to a vector and subsequently returning a scalar. | |