| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
precomp_vv_vari.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP
2 #define STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP
3
4 #include <stan/math/rev/core/vari.hpp>
5 #include <stan/math/rev/core/vv_vari.hpp>
6
7 namespace stan {
8 namespace math {
9
10 // use for single precomputed partials
11 class precomp_vv_vari : public op_vv_vari {
12 protected:
13 double da_;
14 double db_;
15 public:
16 precomp_vv_vari(double val,
17 vari* avi, vari* bvi,
18 double da, double db)
19 : op_vv_vari(val, avi, bvi),
20 da_(da),
21 db_(db) {
22 }
23 void chain() {
24 avi_->adj_ += adj_ * da_;
25 bvi_->adj_ += adj_ * db_;
26 }
27 };
28
29 }
30 }
31 #endif
vari.hpp
stan::math::vari
The variable implementation base class.
Definition: vari.hpp:28
stan::math::precomp_vv_vari::chain
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
Definition: precomp_vv_vari.hpp:23
stan::math::precomp_vv_vari
Definition: precomp_vv_vari.hpp:11
stan::math::precomp_vv_vari::da_
double da_
Definition: precomp_vv_vari.hpp:13
stan::math::precomp_vv_vari::db_
double db_
Definition: precomp_vv_vari.hpp:14
stan::math::op_vv_vari::bvi_
vari * bvi_
Definition: vv_vari.hpp:12
stan::math::precomp_vv_vari::precomp_vv_vari
precomp_vv_vari(double val, vari *avi, vari *bvi, double da, double db)
Definition: precomp_vv_vari.hpp:16
vv_vari.hpp
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:42
stan::math::op_vv_vari::avi_
vari * avi_
Definition: vv_vari.hpp:11
stan::math::op_vv_vari
Definition: vv_vari.hpp:9

[ Stan Home Page ] © 2011–2015, Stan Development Team.