A variable implementation taking a sequence of operands and partial derivatives with respect to the operands.
More...
#include <precomputed_gradients.hpp>
|
| precomputed_gradients_vari (double val, size_t size, vari **varis, double *gradients) |
| Construct a precomputed vari with the specified value, operands, and gradients. More...
|
|
| precomputed_gradients_vari (double val, const std::vector< var > &vars, const std::vector< double > &gradients) |
| Construct a precomputed vari with the specified value, operands, and gradients. More...
|
|
void | chain () |
| Implements the chain rule for this variable, using the prestored operands and gradient. More...
|
|
| vari (const double x) |
| Construct a variable implementation from a value. More...
|
|
| vari (const double x, bool stacked) |
|
virtual | ~vari () |
| Throw an illegal argument exception. More...
|
|
void | init_dependent () |
| Initialize the adjoint for this (dependent) variable to 1. More...
|
|
void | set_zero_adjoint () |
| Set the adjoint value of this variable to 0. More...
|
|
|
static void * | operator new (size_t nbytes) |
| Allocate memory from the underlying memory pool. More...
|
|
static void | operator delete (void *) |
| Delete a pointer from the underlying memory pool. More...
|
|
const double | val_ |
| The value of this variable. More...
|
|
double | adj_ |
| The adjoint of this variable, which is the partial derivative of this variable with respect to the root variable. More...
|
|
A variable implementation taking a sequence of operands and partial derivatives with respect to the operands.
Stan users should use function precomputed_gradients() directly.
Definition at line 21 of file precomputed_gradients.hpp.
stan::math::precomputed_gradients_vari::precomputed_gradients_vari |
( |
double |
val, |
|
|
size_t |
size, |
|
|
vari ** |
varis, |
|
|
double * |
gradients |
|
) |
| |
|
inline |
Construct a precomputed vari with the specified value, operands, and gradients.
- Parameters
-
[in] | val | The value of the variable. |
[in] | size | Size of operands and gradients |
[in] | varis | Operand implementations. |
[in] | gradients | Gradients with respect to operands. |
Definition at line 37 of file precomputed_gradients.hpp.
stan::math::precomputed_gradients_vari::precomputed_gradients_vari |
( |
double |
val, |
|
|
const std::vector< var > & |
vars, |
|
|
const std::vector< double > & |
gradients |
|
) |
| |
|
inline |
Construct a precomputed vari with the specified value, operands, and gradients.
- Parameters
-
[in] | val | The value of the variable. |
[in] | vars | Vector of operands. |
[in] | gradients | Vector of partial derivatives of value with respect to operands. |
- Exceptions
-
std::invalid_argument | if the sizes of the vectors don't match. |
Definition at line 58 of file precomputed_gradients.hpp.
void stan::math::precomputed_gradients_vari::chain |
( |
| ) |
|
|
inlinevirtual |
double* stan::math::precomputed_gradients_vari::gradients_ |
|
protected |
const size_t stan::math::precomputed_gradients_vari::size_ |
|
protected |
vari** stan::math::precomputed_gradients_vari::varis_ |
|
protected |
The documentation for this class was generated from the following file: