template<typename ContainerOperands = std::tuple<>, typename ContainerGradients = std::tuple<>>
class stan::math::precomputed_gradients_vari_template< ContainerOperands, ContainerGradients >
A variable implementation taking a sequence of operands and partial derivatives with respect to the operands.
Stan users should use function precomputed_gradients() directly.
- Template Parameters
-
ContainerOperands | tuple of any container operands ((optionally std vector of) var_value containing Eigen types) |
ContainerGradients | tuple of any container gradients (Eigen types) |
Definition at line 29 of file precomputed_gradients.hpp.
|
template<typename... ContainerOps, typename... ContainerGrads> |
| precomputed_gradients_vari_template (double val, size_t size, vari **varis, double *gradients, const std::tuple< ContainerOps... > &container_operands=std::tuple<>(), const std::tuple< ContainerGrads... > &container_gradients=std::tuple<>()) |
| Construct a precomputed vari with the specified value, operands, gradients and optionally container operands and containers of gradients.
|
|
template<typename Arith , typename VecVar , typename VecArith , typename... ContainerOps, typename... ContainerGrads, require_all_vector_t< VecVar, VecArith > * = nullptr> |
| precomputed_gradients_vari_template (Arith val, const VecVar &vars, const VecArith &gradients, const std::tuple< ContainerOps... > &container_operands=std::tuple<>(), const std::tuple< ContainerGrads... > &container_gradients=std::tuple<>()) |
| Construct a precomputed vari with the specified value, operands, gradients and optionally container operands and containers of gradients.
|
|
void | chain () |
| Implements the chain rule for this variable, using the prestored operands and gradient.
|
|
|
template<typename Op , typename Grad , require_all_not_std_vector_t< Op, Grad > * = nullptr> |
void | chain_one (Op &op, const Grad &grad) |
| Implements the chain rule for one non-std::vector operand.
|
|
template<typename Op , typename OpAlloc , typename Grad , typename GradAlloc > |
void | chain_one (const std::vector< Op, OpAlloc > &op, const std::vector< Grad, GradAlloc > &grad) |
| Implements the chain rule for one std::vector operand.
|
|