Stan Math Library
2.20.0
reverse mode automatic differentiation
stan
math
rev
core
precomp_v_vari.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_REV_CORE_PRECOMP_V_VARI_HPP
2
#define STAN_MATH_REV_CORE_PRECOMP_V_VARI_HPP
3
4
#include <
stan/math/rev/core/vari.hpp
>
5
#include <
stan/math/rev/core/v_vari.hpp
>
6
7
namespace
stan
{
8
namespace
math {
9
10
// use for single precomputed partials
11
class
precomp_v_vari
:
public
op_v_vari
{
12
protected
:
13
double
da_
;
14
15
public
:
16
precomp_v_vari
(
double
val,
vari
* avi,
double
da)
17
:
op_v_vari
(val, avi), da_(da) {}
18
void
chain
() {
avi_
->
adj_
+=
adj_
*
da_
; }
19
};
20
21
}
// namespace math
22
}
// namespace stan
23
#endif
vari.hpp
stan
Definition:
log_sum_exp.hpp:8
stan::math::vari
The variable implementation base class.
Definition:
vari.hpp:30
stan::math::op_v_vari::avi_
vari * avi_
Definition:
v_vari.hpp:11
stan::math::op_v_vari
Definition:
v_vari.hpp:9
v_vari.hpp
stan::math::precomp_v_vari::da_
double da_
Definition:
precomp_v_vari.hpp:13
stan::math::precomp_v_vari
Definition:
precomp_v_vari.hpp:11
stan::math::vari::adj_
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
Definition:
vari.hpp:44
stan::math::precomp_v_vari::chain
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
Definition:
precomp_v_vari.hpp:18
stan::math::precomp_v_vari::precomp_v_vari
precomp_v_vari(double val, vari *avi, double da)
Definition:
precomp_v_vari.hpp:16
[
Stan Home Page
]
© 2011–2018, Stan Development Team.