Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
precomp_v_vari.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__REV__INTERNAL__PRECOMP_V_VARI_HPP
2 #define STAN__AGRAD__REV__INTERNAL__PRECOMP_V_VARI_HPP
3 
6 
7 namespace stan {
8  namespace agrad {
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
precomp_v_vari(double val, vari *avi, double da)
The variable implementation base class.
Definition: vari.hpp:28
void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
Definition: vari.hpp:43

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