![]() |
Stan Math Library
2.15.0
reverse mode automatic differentiation
|
This is a subclass of the vari class for precomputed gradients of cov_exp_quad. More...
#include <cov_exp_quad.hpp>
Public Member Functions | |
cov_exp_quad_vari (const std::vector< T_x > &x, const T_sigma &sigma, const T_l &l) | |
Constructor for cov_exp_quad. More... | |
virtual void | chain () |
Apply the chain rule to this variable based on the variables on which it depends. More... | |
![]() | |
vari (double x) | |
Construct a variable implementation from a value. More... | |
vari (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... | |
Public Attributes | |
const size_t | size_ |
const size_t | size_ltri_ |
const double | l_d_ |
const double | sigma_d_ |
const double | sigma_sq_d_ |
double * | dist_ |
vari * | l_vari_ |
vari * | sigma_vari_ |
vari ** | cov_lower_ |
vari ** | cov_diag_ |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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... | |
This is a subclass of the vari class for precomputed gradients of cov_exp_quad.
The class stores the double values for the distance matrix, pointers to the varis for the covariance matrix, along with a pointer to the vari for sigma, and the vari for l.
T_x | type of std::vector of elements |
T_sigma | type of sigma |
T_l | type of length scale |
Definition at line 36 of file cov_exp_quad.hpp.
|
inline |
Constructor for cov_exp_quad.
All memory allocated in ChainableStack's stack_alloc arena.
It is critical for the efficiency of this object that the constructor create new varis that aren't popped onto the var_stack_, but rather are popped onto the var_nochain_stack_. This is controlled to the second argument to vari's constructor.
x | std::vector input that can be used in square distance Assumes each element of x is the same size |
sigma | standard deviation |
l | length scale |
Definition at line 67 of file cov_exp_quad.hpp.
|
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 from stan::math::vari.
Definition at line 95 of file cov_exp_quad.hpp.
vari** stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::cov_diag_ |
Definition at line 47 of file cov_exp_quad.hpp.
vari** stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::cov_lower_ |
Definition at line 46 of file cov_exp_quad.hpp.
double* stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::dist_ |
Definition at line 43 of file cov_exp_quad.hpp.
const double stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::l_d_ |
Definition at line 40 of file cov_exp_quad.hpp.
vari* stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::l_vari_ |
Definition at line 44 of file cov_exp_quad.hpp.
const double stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::sigma_d_ |
Definition at line 41 of file cov_exp_quad.hpp.
const double stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::sigma_sq_d_ |
Definition at line 42 of file cov_exp_quad.hpp.
vari* stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::sigma_vari_ |
Definition at line 45 of file cov_exp_quad.hpp.
const size_t stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::size_ |
Definition at line 38 of file cov_exp_quad.hpp.
const size_t stan::math::cov_exp_quad_vari< T_x, T_sigma, T_l >::size_ltri_ |
Definition at line 39 of file cov_exp_quad.hpp.