1#ifndef STAN_MATH_FWD_FUN_SUM_HPP
2#define STAN_MATH_FWD_FUN_SUM_HPP
26 std::vector<T> vals(m.size());
27 std::vector<T> tans(m.size());
28 for (
size_t i = 0; i < m.size(); ++i) {
43template <
typename T, require_eigen_vt<is_fvar, T>* =
nullptr>
48 const Eigen::Ref<const plain_type_t<T>>& m_ref = m;
49 return {
sum(m_ref.val()),
sum(m_ref.d())};
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
This template class represents scalars used in forward-mode automatic differentiation,...