Automatic Differentiation
 
Loading...
Searching...
No Matches
scaled_add.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_SCALED_ADD_HPP
2#define STAN_MATH_PRIM_FUN_SCALED_ADD_HPP
3
5#include <vector>
6#include <cstddef>
7
8namespace stan {
9namespace math {
10
11inline void scaled_add(std::vector<double>& x, const std::vector<double>& y,
12 double lambda) {
13 for (size_t i = 0; i < x.size(); ++i) {
14 x[i] += lambda * y[i];
15 }
16}
17
18} // namespace math
19} // namespace stan
20
21#endif
void scaled_add(std::vector< double > &x, const std::vector< double > &y, double lambda)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...