1 #ifndef STAN_MATH_PRIM_FUN_SCALED_ADD_HPP 2 #define STAN_MATH_PRIM_FUN_SCALED_ADD_HPP 3 4 #include <stan/math/prim/meta.hpp> 5 #include <vector> 6 #include <cstddef> 7 8 namespace stan { 9 namespace math { 10 scaled_add(std::vector<double> & x,const std::vector<double> & y,double lambda)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 22