![]() |
Stan
1.1
probability, sampling & optimization
|
Abstract base class for variable implementations that handles memory management and applying the chain rule. More...
#include <agrad.hpp>
Public Member Functions | |
| chainable () | |
| Construct a chainable object. | |
| ~chainable () | |
| Throws a logic exception. | |
| virtual void | chain () |
| Apply the chain rule to this variable based on the variables on which it depends. | |
| virtual void | init_dependent () |
| Initialize this chainable's adjoint value to make it the dependent variable in a gradient calculation. | |
| virtual void | set_zero_adjoint () |
| Set the value of the adjoint for this chainable to its initial value. | |
Static Public Member Functions | |
| static void * | operator new (size_t nbytes) |
| Allocate memory from the underlying memory pool. | |
Abstract base class for variable implementations that handles memory management and applying the chain rule.
|
inline |
|
inline |
|
inlinevirtual |
Apply the chain rule to this variable based on the variables on which it depends.
The base implementation in this class is a no-op.
Reimplemented in stan::agrad::log_determinant_vari< R, C >, stan::agrad::determinant_vari< R, C >, stan::agrad::mdivide_left_tri_vd_vari< TriView, R1, C1, R2, C2 >, stan::agrad::mdivide_left_tri_dv_vari< TriView, R1, C1, R2, C2 >, stan::agrad::mdivide_left_tri_vv_vari< TriView, R1, C1, R2, C2 >, stan::agrad::mdivide_left_vd_vari< R1, C1, R2, C2 >, stan::agrad::mdivide_left_dv_vari< R1, C1, R2, C2 >, stan::agrad::mdivide_left_vv_vari< R1, C1, R2, C2 >, stan::agrad::vari, stan::agrad::gevv_vvv_vari, and stan::agrad::partials_vari.
|
inlinevirtual |
Initialize this chainable's adjoint value to make it the dependent variable in a gradient calculation.
Reimplemented in stan::agrad::vari.
|
inlinestatic |
Allocate memory from the underlying memory pool.
This memory is is managed by the gradient program and will be recovered as a whole. Classes should not be allocated with this operator if they have non-trivial destructors.
| nbytes | Number of bytes to allocate. |
|
inlinevirtual |
Set the value of the adjoint for this chainable to its initial value.
Reimplemented in stan::agrad::vari.