Stan Math Library  2.9.0
reverse mode automatic differentiation
fill.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_FILL_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_FILL_HPP
3 
5 #include <vector>
6 
7 namespace stan {
8 
9  namespace math {
10 
21  template <typename T, typename S>
22  void fill(T& x, const S& y) {
23  x = y;
24  }
25 
38  template <typename T, int R, int C, typename S>
39  void fill(Eigen::Matrix<T, R, C>& x, const S& y) {
40  x.fill(y);
41  }
42 
54  template <typename T, typename S>
55  void fill(std::vector<T>& x, const S& y) {
56  for (size_t i = 0; i < x.size(); ++i)
57  fill(x[i], y);
58  }
59 
60 
61 
62  }
63 }
64 #endif
void fill(T &x, const S &y)
Fill the specified container with the specified value.
Definition: fill.hpp:22

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