Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bessel_second_kind.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__REV__FUNCTIONS__BESSEL_SECOND_KIND_HPP
2 #define STAN__AGRAD__REV__FUNCTIONS__BESSEL_SECOND_KIND_HPP
3 
4 #include <stan/agrad/rev/var.hpp>
10 
11 namespace stan {
12  namespace agrad {
13 
14  namespace {
15 
16  class bessel_second_kind_dv_vari : public op_dv_vari {
17  public:
18  bessel_second_kind_dv_vari(int a, vari* bvi) :
19  op_dv_vari(stan::math::bessel_second_kind(a, bvi->val_), a, bvi) {
20  }
21  void chain() {
22  bvi_->adj_ += adj_ * (ad_ * stan::math::bessel_second_kind(ad_, bvi_->val_) / bvi_->val_ - stan::math::bessel_second_kind(ad_ + 1, bvi_->val_));
23  }
24  };
25  }
26 
27  inline var bessel_second_kind(const int& v,
28  const var& a) {
29  return var(new bessel_second_kind_dv_vari(v, a.vi_));
30  }
31 
32  }
33 }
34 #endif
T2 bessel_second_kind(const int v, const T2 z)
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:40
fvar< T > bessel_second_kind(int v, const fvar< T > &z)
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:27

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