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,
51template <
typename VecVar, require_std_vector_vt<is_var, VecVar>*,
70template <
typename VecContainer, require_std_vector_st<is_var, VecContainer>*,
71 require_std_vector_vt<is_container, VecContainer>*,
typename... Pargs>
73 for (
auto&& x_iter : x) {
92template <
typename EigT, require_eigen_vt<is_var, EigT>*,
typename... Pargs>
108template <
typename... Pargs>
127template <
typename Arith, require_arithmetic_t<scalar_type_t<Arith>>*,
145template <
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,...
size_t count_vars(Pargs &&... args)
Count the number of vars in the input argument list.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...