Stan Math Library  2.20.0
reverse mode automatic differentiation
sub.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_SUB_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_SUB_HPP
3 
5 #include <vector>
6 #include <cstddef>
7 
8 namespace stan {
9 namespace math {
10 
11 inline void sub(std::vector<double>& x, std::vector<double>& y,
12  std::vector<double>& result) {
13  result.resize(x.size());
14  for (size_t i = 0; i < x.size(); ++i)
15  result[i] = x[i] - y[i];
16 }
17 
18 } // namespace math
19 } // namespace stan
20 
21 #endif
void sub(std::vector< double > &x, std::vector< double > &y, std::vector< double > &result)
Definition: sub.hpp:11

     [ Stan Home Page ] © 2011–2018, Stan Development Team.