1#ifndef STAN_MATH_PRIM_FUNCTOR_OPERANDS_AND_PARTIALS_HPP
2#define STAN_MATH_PRIM_FUNCTOR_OPERANDS_AND_PARTIALS_HPP
14template <
typename Op1 = double,
typename Op2 = double,
typename Op3 = double,
15 typename Op4 = double,
typename Op5 = double,
typename Op6 = double,
16 typename Op7 = double,
typename Op8 = double,
17 typename T_return_type
18 = return_type_t<Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8>>
19class operands_and_partials;
43template <
typename ViewElt,
typename Op,
typename Enable =
void>
55template <
typename ViewElt,
typename Op>
58 static constexpr double operands_{0};
72 static constexpr double operand() noexcept {
73 return static_cast<double>(0.0);
80 static constexpr double partial() noexcept {
81 return static_cast<double>(0.0);
87 static constexpr double dx() noexcept {
return static_cast<double>(0); }
92 static constexpr int size() noexcept {
return 0; }
95template <
typename ViewElt,
typename Op>
97 ops_partials_edge<ViewElt, Op, require_st_arithmetic<Op>>::operands_;
139template <
typename Op1,
typename Op2,
typename Op3,
typename Op4,
typename Op5,
140 typename Op6,
typename Op7,
typename Op8,
typename T_return_type>
146 const Op3& )
noexcept {}
148 const Op3& ,
const Op4& )
noexcept {}
150 const Op3& ,
const Op4& ,
151 const Op5& )
noexcept {}
153 const Op3& ,
const Op4& ,
154 const Op5& ,
const Op6& )
noexcept {}
156 const Op3& ,
const Op4& ,
157 const Op5& ,
const Op6& ,
158 const Op7& )
noexcept {}
160 const Op3& ,
const Op4& ,
161 const Op5& ,
const Op6& ,
162 const Op7& ,
const Op8& )
noexcept {}
177 inline double build(
double value)
const noexcept {
return value; }
184 return static_cast<double>(0.0);
192 return static_cast<double>(0.0);
198 static constexpr double dx() noexcept {
return static_cast<double>(0); }
203 static constexpr int size() noexcept {
return 0; }
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.
static constexpr double operand() noexcept
Get the operand for the edge.
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.
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
static constexpr double operand() noexcept
Get the operand for the edge.
operands_and_partials(const Op1 &) noexcept
static constexpr int size() noexcept
Return the size of the operand for the edge.
static constexpr double partial() noexcept
Get the partial for the edge.
operands_and_partials(const Op1 &, const Op2 &, const Op3 &, const Op4 &, const Op5 &, const Op6 &, const Op7 &) noexcept
static constexpr double dx() noexcept
Return the tangent for the edge.
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.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...