Stan Math Library: stan/math/rev/core/precomp_vvv_vari.hpp Source File

| Stan Math Library 2.10.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

precomp_vvv_vari.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_PRECOMP_VVV_VARI_HPP
2 #define STAN_MATH_REV_CORE_PRECOMP_VVV_VARI_HPP
3
4 #include <stan/math/rev/core/vari.hpp>
5 #include <stan/math/rev/core/vvv_vari.hpp>
6
7 namespace stan {
8 namespace math {
9
10 // use for single precomputed partials
11 class precomp_vvv_vari : public op_vvv_vari {
12 protected:
13 double da_;
14 double db_;
15 double dc_;
16 public:
17 precomp_vvv_vari(double val,
18 vari* avi, vari* bvi, vari* cvi,
19 double da, double db, double dc)
20 : op_vvv_vari(val, avi, bvi, cvi),
21 da_(da),
22 db_(db),
23 dc_(dc) {
24 }
25 void chain() {
26 avi_->adj_ += adj_ * da_;
27 bvi_->adj_ += adj_ * db_;
28 cvi_->adj_ += adj_ * dc_;
29 }
30 };
31
32 }
33 }
34 #endif
stan::math::precomp_vvv_vari::chain
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
Definition: precomp_vvv_vari.hpp:25
stan::math::precomp_vvv_vari::dc_
double dc_
Definition: precomp_vvv_vari.hpp:15
stan::math::op_vvv_vari::cvi_
vari * cvi_
Definition: vvv_vari.hpp:14
stan::math::precomp_vvv_vari::da_
double da_
Definition: precomp_vvv_vari.hpp:13
vari.hpp
stan::math::op_vvv_vari
Definition: vvv_vari.hpp:10
stan
Definition: log_sum_exp.hpp:8
stan::math::op_vvv_vari::avi_
vari * avi_
Definition: vvv_vari.hpp:12
stan::math::precomp_vvv_vari::db_
double db_
Definition: precomp_vvv_vari.hpp:14
stan::math::vari
The variable implementation base class.
Definition: vari.hpp:30
stan::math::precomp_vvv_vari::precomp_vvv_vari
precomp_vvv_vari(double val, vari *avi, vari *bvi, vari *cvi, double da, double db, double dc)
Definition: precomp_vvv_vari.hpp:17
vvv_vari.hpp
stan::math::op_vvv_vari::bvi_
vari * bvi_
Definition: vvv_vari.hpp:13
stan::math::precomp_vvv_vari
Definition: precomp_vvv_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 Home Page ] © 2011–2016, Stan Development Team.