1#ifndef STAN_MATH_REV_FUN_FILL_HPP
2#define STAN_MATH_REV_FUN_FILL_HPP
23template <
typename VarMat,
typename S, require_var_matrix_t<VarMat>* =
nullptr,
24 require_var_t<S>* =
nullptr>
25inline void fill(VarMat& x,
const S& y) {
27 x.vi_->val_.fill(y.val());
29 x.vi_->val_ = prev_vals;
30 y.adj() += x.adj().sum();
46template <
typename VarMat,
typename S, require_var_matrix_t<VarMat>* =
nullptr,
47 require_arithmetic_t<S>* =
nullptr>
48inline void fill(VarMat& x,
const S& y) {
52 x.vi_->val_ = prev_vals;
void reverse_pass_callback(F &&functor)
Puts a callback on the autodiff stack to be called in reverse pass.
void fill(EigMat &x, const S &y)
Fill the specified container with the specified value.
typename internal::arena_type_impl< std::decay_t< T > >::type arena_t
Determines a type that can be used in place of T that does any dynamic allocations on the AD stack.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...