| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
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
stan::math::fill
void fill(T &x, const S &y)
Fill the specified container with the specified value.
Definition: fill.hpp:22
Eigen.hpp

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