1#ifndef STAN_MATH_REV_CORE_COUNT_VARS_HPP
2#define STAN_MATH_REV_CORE_COUNT_VARS_HPP
15template <
typename VecVar, require_std_vector_vt<is_var, VecVar>* =
nullptr,
17inline size_t count_vars_impl(
size_t count, VecVar&& x, Pargs&&... args);
19template <
typename VecContainer,
20 require_std_vector_st<is_var, VecContainer>* =
nullptr,
21 require_std_vector_vt<is_container, VecContainer>* =
nullptr,
23inline size_t count_vars_impl(
size_t count, VecContainer&& x, Pargs&&... args);
25template <
typename EigT, require_eigen_vt<is_var, EigT>* =
nullptr,
29template <
typename... Pargs>
32template <
typename Arith, require_arithmetic_t<scalar_type_t<Arith>>* =
nullptr,
50template <
typename VecVar, require_std_vector_vt<is_var, VecVar>*,
69template <
typename VecContainer, require_std_vector_st<is_var, VecContainer>*,
70 require_std_vector_vt<is_container, VecContainer>*,
typename... Pargs>
72 for (
auto&& x_iter : x) {
91template <
typename EigT, require_eigen_vt<is_var, EigT>*,
typename... Pargs>
107template <
typename... Pargs>
126template <
typename Arith, require_arithmetic_t<scalar_type_t<Arith>>*,
140template <
typename... Pargs,
typename... Args>
142 const std::tuple<Pargs...>&
arg, Args&&... args) {
145 [count](
auto&&... inner_args) {
149 std::forward<Args>(args)...);
160template <
typename... Pargs>
size_t count_vars_impl(size_t count, VecVar &&x, Pargs &&... args)
Count the number of vars in x (a std::vector of vars), add it to the running total,...
fvar< T > arg(const std::complex< fvar< T > > &z)
Return the phase angle of the complex argument.
size_t count_vars(Pargs &&... args)
Count the number of vars in the input argument list.
constexpr decltype(auto) apply(F &&f, Tuple &&t, PreArgs &&... pre_args)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...