![]() |
Stan Math Library
5.1.0
Automatic Differentiation
|
|
inline |
Base template function for vectorization of ternary 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 three nested containers (std::vectors).
Specialization for use with (non-nested) std::vectors.
Specialization for use with three Eigen inputs.
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 | An Arithmetic, Integral, var, or fvar<T> type. |
T2 | An Arithmetic, Integral, var, or fvar<T> type. |
T3 | An Arithmetic, Integral, var, or fvar<T> type. |
F | Type of functor to apply. |
x | First input to which operation is applied. |
y | Second input to which operation is applied. |
z | Third scalar to which operation is applied. |
f | functor to apply to inputs. |
Eigen's ternaryExpr framework is used for more efficient indexing of both row- and column-major inputs without separate loops.
T1 | Eigen type of first argument to which functor is applied. |
T2 | Eigen type Type of second argument to which functor is applied. |
T3 | Eigen type of third argument to which functor is applied. |
F | Type of functor to apply. |
x | First Eigen input to which operation is applied. |
y | Second Eigen input to which operation is applied. |
z | Third Eigen input to which operation is applied. |
f | functor to apply to Eigen input. |
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. |
T3 | Type of third 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. |
z | Third 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. |
T3 | 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. |
z | Third std::vector input to which operation is applied. |
f | functor to apply to std::vector inputs. |
Definition at line 39 of file apply_scalar_ternary.hpp.