| 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_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 public:
15 precomp_v_vari(double val, vari* avi, double da)
16 : op_v_vari(val, avi),
17 da_(da) {
18 }
19 void chain() {
20 avi_->adj_ += adj_ * da_;
21 }
22 };
23
24 }
25 }
26 #endif
vari.hpp
stan::math::vari
The variable implementation base class.
Definition: vari.hpp:28
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:42
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:19
stan::math::precomp_v_vari::precomp_v_vari
precomp_v_vari(double val, vari *avi, double da)
Definition: precomp_v_vari.hpp:15

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