1#ifndef STAN_MATH_PRIM_FUNCTOR_OPERANDS_AND_PARTIALS_HPP
2#define STAN_MATH_PRIM_FUNCTOR_OPERANDS_AND_PARTIALS_HPP
15template <
typename Op1 = double,
typename Op2 = double,
typename Op3 = double,
16 typename Op4 = double,
typename Op5 = double,
typename Op6 = double,
17 typename Op7 = double,
typename Op8 = double,
18 typename T_return_type
19 = return_type_t<Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8>>
20class operands_and_partials;
44template <
typename ViewElt,
typename Op,
typename Enable =
void>
56template <
typename ViewElt,
typename Op>
59 using inner_op = std::conditional_t<is_eigen<value_type_t<Op>>::value,
70 static constexpr double operands_{0};
84 static constexpr double operand() noexcept {
85 return static_cast<double>(0.0);
92 static constexpr double partial() noexcept {
93 return static_cast<double>(0.0);
99 static constexpr double dx() noexcept {
return static_cast<double>(0); }
104 static constexpr int size() noexcept {
return 0; }
107template <
typename ViewElt,
typename Op>
109 ops_partials_edge<ViewElt, Op, require_st_arithmetic<Op>>::operands_;
151template <
typename Op1,
typename Op2,
typename Op3,
typename Op4,
typename Op5,
152 typename Op6,
typename Op7,
typename Op8,
typename T_return_type>
158 const Op3& )
noexcept {}
160 const Op3& ,
const Op4& )
noexcept {}
162 const Op3& ,
const Op4& ,
163 const Op5& )
noexcept {}
165 const Op3& ,
const Op4& ,
166 const Op5& ,
const Op6& )
noexcept {}
168 const Op3& ,
const Op4& ,
169 const Op5& ,
const Op6& ,
170 const Op7& )
noexcept {}
172 const Op3& ,
const Op4& ,
173 const Op5& ,
const Op6& ,
174 const Op7& ,
const Op8& )
noexcept {}
189 inline double build(
double value)
const noexcept {
return value; }
ops_partials_edge()=default
static constexpr double dx() noexcept
Return the tangent for the edge.
static constexpr int size() noexcept
Return the size of the operand for the edge.
partials_t partials_
The partials_ are always called in if statements that will be removed by the dead code elimination pa...
std::conditional_t< is_eigen< value_type_t< Op > >::value, value_type_t< Op >, Op > inner_op
static constexpr double operand() noexcept
Get the operand for the edge.
empty_broadcast_array< partials_t, inner_op > partials_vec_
constexpr ops_partials_edge(T &&) noexcept
static constexpr double partial() noexcept
Get the partial for the edge.
An edge holds both the operands and its associated partial derivatives.
internal::ops_partials_edge< double, std::decay_t< Op2 > > edge2_
internal::ops_partials_edge< double, std::decay_t< Op7 > > edge7_
internal::ops_partials_edge< double, std::decay_t< Op4 > > edge4_
operands_and_partials(const Op1 &, const Op2 &, const Op3 &) noexcept
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &, const Op5 &) noexcept
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &) noexcept
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &, const Op5 &, const Op6 &, const Op7 &, const Op8 &) noexcept
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &, const Op5 &, const Op6 &) noexcept
operands_and_partials(const Op1 &, const Op2 &) noexcept
internal::ops_partials_edge< double, std::decay_t< Op6 > > edge6_
internal::ops_partials_edge< double, std::decay_t< Op1 > > edge1_
internal::ops_partials_edge< double, std::decay_t< Op8 > > edge8_
internal::ops_partials_edge< double, std::decay_t< Op5 > > edge5_
operands_and_partials(const Op1 &) noexcept
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &, const Op5 &, const Op6 &, const Op7 &) noexcept
internal::ops_partials_edge< double, std::decay_t< Op3 > > edge3_
This template builds partial derivatives with respect to a set of operands.
require_t< std::is_arithmetic< scalar_type_t< std::decay_t< T > > > > require_st_arithmetic
Require scalar type satisfies std::is_arithmetic.
require_not_t< std::is_same< std::decay_t< T >, std::decay_t< S > > > require_not_same_t
Require types T and S does not satisfy std::is_same.
double build(double value) const noexcept
Build the node to be stored on the autodiff graph.
typename value_type< T >::type value_type_t
Helper function for accessing underlying type.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...