1 #ifndef STAN_MATH_REV_ARR_FUN_SUM_HPP
2 #define STAN_MATH_REV_ARR_FUN_SUM_HPP
19 inline static double sum_of_val(
const std::vector<var>& v) {
21 for (
size_t i = 0; i < v.size(); i++)
36 for (
size_t i = 0; i <
length_; i++)
41 for (
size_t i = 0; i <
length_; i++) {
53 inline var sum(
const std::vector<var>& m) {
fvar< T > sum(const std::vector< fvar< T > > &m)
Return the sum of the entries of the specified standard vector.
sum_v_vari(double value, vari **v, size_t length)
The variable implementation base class.
size_t length(const std::vector< T > &x)
Independent (input) and dependent (output) variables for gradients.
virtual void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
int size(const std::vector< T > &x)
Return the size of the specified standard vector.
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
static double sum_of_val(const std::vector< var > &v)
Class for sums of variables constructed with standard vectors.
sum_v_vari(const std::vector< var > &v1)