1#ifndef STAN_MATH_REV_FUN_FILL_HPP
2#define STAN_MATH_REV_FUN_FILL_HPP
24template <
typename VarMat,
typename S, require_var_matrix_t<VarMat>* =
nullptr,
25 require_var_t<S>* =
nullptr>
26inline void fill(VarMat& x,
const S& y) {
28 x.vi_->val_.fill(y.val());
30 x.vi_->val_ = prev_vals;
31 y.adj() += x.adj().sum();
47template <
typename VarMat,
typename S, require_var_matrix_t<VarMat>* =
nullptr,
48 require_arithmetic_t<S>* =
nullptr>
49inline void fill(VarMat& x,
const S& y) {
53 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 ...