Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
stan
math
functions
sum.hpp
Go to the documentation of this file.
1
#ifndef STAN__MATH__FUNCTIONS__SUM_HPP
2
#define STAN__MATH__FUNCTIONS__SUM_HPP
3
4
#include <vector>
5
#include <cstddef>
6
7
namespace
stan {
8
namespace
math {
9
10
inline
double
sum
(std::vector<double>& x) {
11
double
sum
= x[0];
12
for
(
size_t
i = 1; i < x.size(); ++i)
13
sum += x[i];
14
return
sum
;
15
}
16
17
}
18
}
19
20
#endif
stan::math::sum
double sum(std::vector< double > &x)
Definition:
sum.hpp:10
[
Stan Home Page
]
© 2011–2014, Stan Development Team.