<commit_before>#ifndef __STAN__MATH__MATRIX__CUMULATIVE_SUM_HPP__
#define __STAN__MATH__MATRIX__CUMULATIVE_SUM_HPP__

#include <vector>
#include <stan/math/matrix/Eigen.hpp>

namespace stan {
  namespace math {

    /**
     * Return the cumulative sum of the specified vector.
     *
     * The cumulative sum of a vector of values \code{x} is the
     *
     * @code x[0], x[1] + x[2], ..., x[1] + ,..., + x[x.size()-1] @endcode
     *
     * @tparm T Scalar type of vector.
     * @param x Vector of values.
     * @return Cumulative sum of values.
     */
    template <typename T>
    inline std::vector<T>
    cumulative_sum(const std::vector<T>& x) {
      std::vector<T> result(x.size());
      if (x.size() == 0)
        return result;
      result[0] = x[0];
      for (size_t i = 1; i < result.size(); ++i)
        result[i] = x[i] + result[i-1];
      return result;
    }
    
    /**
     * Return the cumulative sum of the specified matrix.
     *
     * The cumulative sum is of the same type as the input and
     * has values defined by
     *
     * @code x(0), x(1) + x(2), ..., x(1) + ,..., + x(x.size()-1) @endcode
     *
     * @tparm T Scalar type of matrix.
     * @tparam R Row type of matrix.
     * @tparam C Column type of matrix.
     * @param x Vector of values.
     * @return Cumulative sum of values.
     */<commit_msg>changed @tparm to @tparam--most likely typo--changed x to m so documentation matched code<commit_after>#ifndef __STAN__MATH__MATRIX__CUMULATIVE_SUM_HPP__
#define __STAN__MATH__MATRIX__CUMULATIVE_SUM_HPP__

#include <vector>
#include <stan/math/matrix/Eigen.hpp>

namespace stan {
  namespace math {

    /**
     * Return the cumulative sum of the specified vector.
     *
     * The cumulative sum of a vector of values \code{x} is the
     *
     * @code x[0], x[1] + x[2], ..., x[1] + ,..., + x[x.size()-1] @endcode
     *
     * @tparam T Scalar type of vector.
     * @param x Vector of values.
     * @return Cumulative sum of values.
     */
    template <typename T>
    inline std::vector<T>
    cumulative_sum(const std::vector<T>& x) {
      std::vector<T> result(x.size());
      if (x.size() == 0)
        return result;
      result[0] = x[0];
      for (size_t i = 1; i < result.size(); ++i)
        result[i] = x[i] + result[i-1];
      return result;
    }
    
    /**
     * Return the cumulative sum of the specified matrix.
     *
     * The cumulative sum is of the same type as the input and
     * has values defined by
     *
     * @code x(0), x(1) + x(2), ..., x(1) + ,..., + x(x.size()-1) @endcode
     *
     * @tparam T Scalar type of matrix.
     * @tparam R Row type of matrix.
     * @tparam C Column type of matrix.
     * @param m Matrix of values. 
     * @return Cumulative sum of values.
     */
{'fraction_non_alphanumeric': 0.13850017940437748, 'fraction_numerical': 0.010764262648008612, 'mean_word_length': 2.2494172494172493, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6188140', 'n_tokens_mistral': 1002, 'n_tokens_neox': 972, 'n_words': 296}