Automatic Differentiation
 
Loading...
Searching...
No Matches
fill.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_FILL_HPP
2#define STAN_MATH_PRIM_FUN_FILL_HPP
3
6#include <vector>
7
8namespace stan {
9namespace math {
10
22template <typename EigMat, typename S, require_eigen_t<EigMat>* = nullptr,
23 require_stan_scalar_t<S>* = nullptr>
24inline void fill(EigMat& x, const S& y) {
25 x.fill(y);
26}
27
38template <
39 typename T, typename S,
40 require_t<std::is_assignable<std::decay_t<T>&, std::decay_t<S>>>* = nullptr>
41inline void fill(T& x, S&& y) {
42 x = std::forward<S>(y);
43}
44
56template <typename Vec, typename S, require_std_vector_t<Vec>* = nullptr>
57inline void fill(Vec& x, S&& y) {
58 for (auto& x_val : x) {
59 fill(x_val, y);
60 }
61}
62
63} // namespace math
64} // namespace stan
65
66#endif
void fill(EigMat &x, const S &y)
Fill the specified container with the specified value.
Definition fill.hpp:24
std::enable_if_t< Check::value > require_t
If condition is true, template is enabled.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...