1#ifndef STAN_MATH_REV_META_PARTIALS_PROPOGATOR_HPP
2#define STAN_MATH_REV_META_PARTIALS_PROPOGATOR_HPP
49template <
typename ReturnType,
typename... Ops>
56 template <
typename... Types>
60 std::forward<Types>(ops))...) {}
78 [ret](
auto&&
edge)
mutable {
80 [operand =
edge.operand(), partial =
edge.partial(),
81 ret]()
mutable { update_adjoints(operand, partial, ret); });
An edge holds both the operands and its associated partial derivatives.
std::tuple< internal::ops_partials_edge< double, plain_type_t< std::decay_t< Ops > > >... > edges_
partials_propagator(Types &&... ops)
var build(double value)
Build the node to be stored on the autodiff graph.
require_t< is_var< std::decay_t< T > > > require_var_t
Require type satisfies is_var.
constexpr auto for_each(F &&f, T &&t)
Apply a function to each element of a tuple.
constexpr auto & edge(internal::partials_propagator< Types... > &x) noexcept
Access the edge of an partials_propagator
void reverse_pass_callback(F &&functor)
Puts a callback on the autodiff stack to be called in reverse pass.
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...