Automatic Differentiation
 
Loading...
Searching...
No Matches
apply_scalar_unary.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUNCTOR_APPLY_SCALAR_UNARY_HPP
2#define STAN_MATH_FWD_FUNCTOR_APPLY_SCALAR_UNARY_HPP
3
6
7namespace stan {
8namespace math {
9
20template <typename F, typename T>
26 using return_t = std::decay_t<T>;
27
34 template <typename T2>
35 static inline auto apply(T2&& x) {
36 return F::fun(std::forward<T2>(x));
37 }
38};
39
40} // namespace math
41} // namespace stan
42#endif
require_t< is_fvar< std::decay_t< T > > > require_fvar_t
Require type satisfies is_fvar.
Definition is_fvar.hpp:34
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
std::decay_t< T > return_t
Function return type, which is same as the argument type for the function, fvar<T>.
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...