1#ifndef STAN_MATH_REV_FUN_NORM1_HPP
2#define STAN_MATH_REV_FUN_NORM1_HPP
22template <
typename T, require_eigen_vector_vt<is_var, T>* =
nullptr>
27 arena_v.adj().array() += res.adj() *
sign(arena_v.val().array());
40template <
typename T, require_var_matrix_t<T>* =
nullptr>
43 v.adj().array() += res.adj() * sign(v.val().array());
auto sign(const T &x)
Returns signs of the arguments.
void reverse_pass_callback(F &&functor)
Puts a callback on the autodiff stack to be called in reverse pass.
auto norm1(const Container &x)
Compute the L1 norm of the specified vector of values.
internal::callback_vari< plain_type_t< T >, F > * make_callback_vari(T &&value, F &&functor)
Creates a new vari with given value and a callback that implements the reverse pass (chain).
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 ...