fill.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_ARR_FUN_FILL_HPP
2 #define STAN_MATH_PRIM_ARR_FUN_FILL_HPP
3 
5 #include <vector>
6 
7 namespace stan {
8 namespace math {
9 
10 /**
11  * Fill the specified container with the specified value.
12  *
13  * Each container in the specified standard vector is filled
14  * recursively by calling <code>fill</code>.
15  *
16  * @tparam T Type of container in vector.
17  * @tparam S Type of value.
18  * @param[in] x Container.
19  * @param[in, out] y Value.
20  */
21 template <typename T, typename S>
22 void fill(std::vector<T>& x, const S& y) {
23  for (typename std::vector<T>::size_type i = 0; i < x.size(); ++i)
24  fill(x[i], y);
25 }
26 
27 } // namespace math
28 } // namespace stan
29 #endif
#define S(x, n)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Definition: typedefs.hpp:11
void fill(std::vector< T > &x, const S &y)
Definition: fill.hpp:22