Abstract base class for variable implementations that handles memory management and applying the chain rule.
More...
#include <agrad.hpp>
|
| | chainable () |
| | Construct a chainable object. More...
|
| |
| | ~chainable () |
| | Throws a logic exception. More...
|
| |
| virtual void | chain () |
| | Apply the chain rule to this variable based on the variables on which it depends. More...
|
| |
| virtual void | init_dependent () |
| | Initialize this chainable's adjoint value to make it the dependent variable in a gradient calculation. More...
|
| |
| virtual void | set_zero_adjoint () |
| | Set the value of the adjoint for this chainable to its initial value. More...
|
| |
|
| static void * | operator new (size_t nbytes) |
| | Allocate memory from the underlying memory pool. More...
|
| |
Abstract base class for variable implementations that handles memory management and applying the chain rule.
Definition at line 34 of file agrad.hpp.
◆ chainable()
| stan::agrad::chainable::chainable |
( |
| ) |
|
|
inline |
Construct a chainable object.
The implementation in this abstract base class is a no-op.
Definition at line 42 of file agrad.hpp.
◆ ~chainable()
| stan::agrad::chainable::~chainable |
( |
| ) |
|
|
inline |
Throws a logic exception.
Chainables are not destructible by clients because the vari stack manages all memory for auto-dif.
Definition at line 49 of file agrad.hpp.
◆ chain()
| virtual void stan::agrad::chainable::chain |
( |
| ) |
|
|
inlinevirtual |
◆ init_dependent()
| virtual void stan::agrad::chainable::init_dependent |
( |
| ) |
|
|
inlinevirtual |
Initialize this chainable's adjoint value to make it the dependent variable in a gradient calculation.
Reimplemented in stan::agrad::vari.
Definition at line 65 of file agrad.hpp.
◆ operator new()
| static void* stan::agrad::chainable::operator new |
( |
size_t |
nbytes | ) |
|
|
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.
- Parameters
-
| nbytes | Number of bytes to allocate. |
- Returns
- Pointer to allocated bytes.
Definition at line 85 of file agrad.hpp.
◆ set_zero_adjoint()
| virtual void stan::agrad::chainable::set_zero_adjoint |
( |
| ) |
|
|
inlinevirtual |
Set the value of the adjoint for this chainable to its initial value.
Reimplemented in stan::agrad::vari.
Definition at line 72 of file agrad.hpp.
The documentation for this class was generated from the following file: