Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Base template function for vectorization of binary scalar functions defined by applying a functor to a combination of scalars, containers of matching sizes, or a combination of a scalar and a container.
Specialization for use with two nested containers (std::vectors).
Specialization for use with (non-nested) std::vectors.
These containers can be a standard library vector, Eigen dense matrix expression template, or container of these. For each specialization, the same type as the largest (dimension) input is returned.
This base template function takes (and returns) scalars.
T1 | Type of first argument to which functor is applied. |
T2 | Type of second argument to which functor is applied. |
F | Type of functor to apply. |
x | First input to which operation is applied. |
y | Second input to which operation is applied. |
f | functor to apply to inputs. |
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).
T1 | Type of first std::vector to which functor is applied. |
T2 | Type of second std::vector to which functor is applied. |
F | Type of functor to apply. |
x | First std::vector input to which operation is applied. |
y | Second std::vector input to which operation is applied. |
f | functor to apply to std::vector inputs. |
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
T1 | Type of first std::vector to which functor is applied. |
T2 | Type of second std::vector to which functor is applied. |
F | Type of functor to apply. |
x | First std::vector input to which operation is applied. |
y | Second std::vector input to which operation is applied. |
f | functor to apply to std::vector inputs. |
Definition at line 37 of file apply_scalar_binary.hpp.