![]() |
Stan Math Library
2.10.0
reverse mode automatic differentiation
|
Base template class for vectorization of unary scalar functions defined by a template class F
to a scalar, standard library vector, or Eigen dense matrix expression template.
More...
#include <apply_scalar_unary.hpp>
Public Types | |
typedef Eigen::internal::traits< T >::Scalar | scalar_t |
Type of underlying scalar for the matrix type T. More... | |
typedef Eigen::Matrix< scalar_t, T::RowsAtCompileTime, T::ColsAtCompileTime > | return_t |
Return type for applying the function elementwise to a matrix expression template of type T. More... | |
Static Public Member Functions | |
static return_t | apply (const T &x) |
Return the result of applying the function defined by the template parameter F to the specified matrix argument. More... | |
Base template class for vectorization of unary scalar functions defined by a template class F
to a scalar, standard library vector, or Eigen dense matrix expression template.
The base class applies to any Eigen dense matrix expression template. Specializations define applications to scalars (primitive or autodiff in the corresponding autodiff library directories) or to standard library vectors of vectorizable types (primitives, Eigen dense matrix expressions, or further standard vectors).
Each specialization must define the typedef return_t
for the vectorized return type and the function apply
which defines the vectorization or base application of the function defined statically by the class F. The function definition class F defines a static function fun()
, which defines the function's behavior on scalars.
F | Type of function to apply. |
T | Type of argument to which function is applied. |
Definition at line 36 of file apply_scalar_unary.hpp.
typedef Eigen::Matrix<scalar_t, T::RowsAtCompileTime, T::ColsAtCompileTime> stan::math::apply_scalar_unary< F, T >::return_t |
Return type for applying the function elementwise to a matrix expression template of type T.
Definition at line 48 of file apply_scalar_unary.hpp.
typedef Eigen::internal::traits<T>::Scalar stan::math::apply_scalar_unary< F, T >::scalar_t |
Type of underlying scalar for the matrix type T.
Definition at line 40 of file apply_scalar_unary.hpp.
|
inlinestatic |
Return the result of applying the function defined by the template parameter F to the specified matrix argument.
x | Matrix to which operation is applied. |
Definition at line 58 of file apply_scalar_unary.hpp.