Automatic Differentiation
 
Loading...
Searching...
No Matches
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
6
7namespace stan {
8namespace math {
9
10// use for single precomputed partials
11class precomp_vv_vari final : public op_vv_vari {
12 protected:
13 double da_;
14 double db_;
15
16 public:
17 precomp_vv_vari(double val, vari* avi, vari* bvi, double da, double db)
18 : op_vv_vari(val, avi, bvi), da_(da), db_(db) {}
19 void chain() {
20 avi_->adj_ += adj_ * da_;
21 bvi_->adj_ += adj_ * db_;
22 }
23};
24
25} // namespace math
26} // namespace stan
27#endif
precomp_vv_vari(double val, vari *avi, vari *bvi, double da, double db)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...