Automatic Differentiation
 
Loading...
Searching...
No Matches
possibly_sum.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_META_POSSIBLY_SUM_HPP
2#define STAN_MATH_PRIM_META_POSSIBLY_SUM_HPP
3
6
7namespace stan {
8namespace math {
9
17template <typename CondSum, typename T, require_t<CondSum>* = nullptr>
18inline auto possibly_sum(T&& x) {
19 return sum(std::forward<T>(x));
20}
21
29template <typename CondSum, typename T1, require_not_t<CondSum>* = nullptr>
30inline auto possibly_sum(T1&& x) {
31 return std::forward<T1>(x);
32}
33
34} // namespace math
35} // namespace stan
36
37#endif
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
Definition sum.hpp:22
auto possibly_sum(T &&x)
Conditionally sum the input at compile time.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9