1#ifndef STAN_MATH_REV_FUN_TRACE_HPP
2#define STAN_MATH_REV_FUN_TRACE_HPP
22template <
typename T, require_rev_matrix_t<T>* =
nullptr>
27 [arena_m](
const auto& vi)
mutable {
28 arena_m.adj().diagonal().array() += vi.adj();
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
value_type_t< T > trace(const T &m)
Calculates trace (sum of diagonal) of given kernel generator expression.
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 ...