1#ifndef STAN_MATH_REV_FUNCTOR_APPLY_VECTOR_UNARY_HPP
2#define STAN_MATH_REV_FUNCTOR_APPLY_VECTOR_UNARY_HPP
27 template <
typename T2,
typename F>
28 static inline auto apply(T2&& x, F&& f) {
29 return std::forward<F>(f)(std::forward<T2>(x));
42 template <
typename T2,
typename F>
44 return std::forward<F>(f)(std::forward<T2>(x));
58 template <
typename T2,
typename F>
59 static inline auto reduce(T2& x, F&& f) {
60 return make_holder(std::forward<F>(f), std::forward<T2>(x));
require_t< is_var_matrix< std::decay_t< T > > > require_var_matrix_t
Require type satisfies is_var_matrix.
auto make_holder(F &&func, Args &&... args)
Calls given function with given arguments.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static auto apply(T2 &&x, F &&f)
Member function for applying a functor to a var_value<T> and subsequently returning a var_value<T>.
static auto reduce(T2 &x, F &&f)
Member function for applying a functor to a var_value<T> and subsequently returning a var.
static auto apply_no_holder(T2 &&x, F &&f)
Member function for applying a functor to a var_value<T> and subsequently returning a var_value<T>.