Stan Math Library  2.20.0
reverse mode automatic differentiation
apply_scalar_unary.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_MAT_VECTORIZE_APPLY_SCALAR_UNARY_HPP
2 #define STAN_MATH_FWD_MAT_VECTORIZE_APPLY_SCALAR_UNARY_HPP
3 
6 
7 namespace stan {
8 namespace math {
9 
20 template <typename F, typename T>
21 struct apply_scalar_unary<F, fvar<T> > {
26  typedef fvar<T> return_t;
27 
34  static inline return_t apply(const fvar<T>& x) { return F::fun(x); }
35 };
36 
37 } // namespace math
38 } // namespace stan
39 #endif
fvar< T > return_t
Function return type, which is same as the argument type for the function, fvar<T>.
static return_t apply(const fvar< T > &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...
This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type.
Definition: fvar.hpp:41

     [ Stan Home Page ] © 2011–2018, Stan Development Team.