Automatic Differentiation
 
Loading...
Searching...
No Matches
apply_vector_unary.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_FUNCTOR_APPLY_VECTOR_UNARY_HPP
2#define STAN_MATH_REV_FUNCTOR_APPLY_VECTOR_UNARY_HPP
3
6#include <vector>
7
8namespace stan {
9namespace math {
10
15template <typename T>
27 template <typename F>
28 static inline plain_type_t<T> apply(const T& x, const F& f) {
29 return f(x);
30 }
31
42 template <typename F>
43 static inline plain_type_t<T> apply_no_holder(const T& x, const F& f) {
44 return f(x);
45 }
46
58 template <typename F>
59 static inline var reduce(const T& x, const F& f) {
60 return f(x);
61 }
62};
63
64} // namespace math
65} // namespace stan
66#endif
require_t< is_var_matrix< std::decay_t< T > > > require_var_matrix_t
Require type satisfies is_var_matrix.
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static plain_type_t< T > apply_no_holder(const T &x, const F &f)
Member function for applying a functor to a var_value<T> and subsequently returning a var_value<T>.
static plain_type_t< T > apply(const T &x, const F &f)
Member function for applying a functor to a var_value<T> and subsequently returning a var_value<T>.
static var reduce(const T &x, const F &f)
Member function for applying a functor to a var_value<T> and subsequently returning a var.