Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ cumulative_sum() [5/5]

template<typename EigVec , require_rev_vector_t< EigVec > * = nullptr>
auto stan::math::cumulative_sum ( const EigVec &  x)
inline

Return the cumulative sum of the specified vector.

The cumulative sum is of the same type as the input and has values defined by

x(0), x(1) + x(2), ..., x(1) + , ..., + x(x.size()-1)
Template Parameters
EigVectype derived from Eigen::EigenBase or a var_value<T> with T deriving from Eigen::EigenBase with one compile time dimension equal to 1
Parameters
xVector of values.
Returns
Cumulative sum of values.

Definition at line 30 of file cumulative_sum.hpp.