Automatic Differentiation
 
Loading...
Searching...
No Matches
apply_scalar_unary.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_FUNCTOR_APPLY_SCALAR_UNARY_HPP
2#define STAN_MATH_REV_FUNCTOR_APPLY_SCALAR_UNARY_HPP
3
6
7namespace stan {
8namespace math {
9
18template <typename F, typename T>
20 F, T, std::enable_if_t<is_var<T>::value && is_stan_scalar<T>::value>> {
24 using return_t = var;
25
32 template <typename T2>
33 static inline auto apply(T2&& x) {
34 return F::fun(std::forward<T2>(x));
35 }
36};
37
38template <typename F, typename T>
44
51 template <typename T2>
52 static inline auto apply(T2&& x) {
53 return F::fun(std::forward<T2>(x));
54 }
55};
56
57} // namespace math
58} // namespace stan
59#endif
require_t< is_var_matrix< std::decay_t< T > > > require_var_matrix_t
Require type satisfies is_var_matrix.
var_value< double > var
Definition var.hpp:1187
typename plain_type< std::decay_t< T > >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
plain_type_t< T > return_t
Function return type, which is a var_value with plain value type.
static auto apply(T2 &&x)
Apply the function specified by F to the specified argument.
static auto apply(T2 &&x)
Apply the function specified by F to the specified argument.
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...