Stan Math Library: stan/math/prim/arr/fun/sub.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <vector>
5 #include <cstddef>
6
7 namespace stan {
8 namespace math {
9
10 inline void sub(std::vector<double>& x, std::vector<double>& y,
11 std::vector<double>& result) {
12 result.resize(x.size());
13 for (size_t i = 0; i < x.size(); ++i)
14 result[i] = x[i] - y[i];
15 }
16
17 }
18 }
19
20 #endif
stan::math::sub
void sub(std::vector< double > &x, std::vector< double > &y, std::vector< double > &result)
Definition: sub.hpp:10
stan
Definition: log_sum_exp.hpp:8

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