Skip to content

Commit 886073c

Browse files
committed
add back accidentally deleted accumulate and count vars
1 parent 0b88d1c commit 886073c

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

stan/math/prim/functor/iter_tuple_nested.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace stan::math {
2020
* only create side effects.
2121
*/
2222
template <typename F, typename... Types>
23-
inline auto iter_tuple_nested(F&& f, Types&&... args) {
23+
inline void iter_tuple_nested(F&& f, Types&&... args) {
2424
constexpr bool is_vec_container
2525
= (is_std_vector_v<Types> && ...)
2626
&& (!is_stan_scalar<value_type_t<Types>>::value && ...);

stan/math/rev/core/accumulate_adjoints.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ inline double* accumulate_adjoints(double* dest, Arith&& x, Pargs&&... args) {
140140
return accumulate_adjoints(dest, std::forward<Pargs>(args)...);
141141
}
142142

143+
/**
144+
* End accumulate_adjoints recursion and return pointer
145+
*
146+
* @param dest Pointer
147+
*/
148+
inline double* accumulate_adjoints(double* dest) { return dest; }
149+
143150
} // namespace math
144151
} // namespace stan
145152

stan/math/rev/core/count_vars.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ template <typename Arith, require_arithmetic_t<scalar_type_t<Arith>>* = nullptr,
3333
typename... Pargs>
3434
inline size_t count_vars_impl(size_t count, Arith& x, Pargs&&... args);
3535

36+
inline size_t count_vars_impl(size_t count);
3637
/**
3738
* Count the number of vars in x (a std::vector of vars),
3839
* add it to the running total,

0 commit comments

Comments
 (0)