Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
log10.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__REV__FUNCTIONS__LOG10_HPP
2 #define STAN__AGRAD__REV__FUNCTIONS__LOG10_HPP
3 
4 #include <cmath>
5 #include <stan/agrad/rev/var.hpp>
8 
9 namespace stan {
10  namespace agrad {
11 
12  namespace {
13  class log10_vari : public op_v_vari {
14  public:
15  const double exp_val_;
16  log10_vari(vari* avi) :
17  op_v_vari(std::log10(avi->val_),avi),
18  exp_val_(avi->val_) {
19  }
20  void chain() {
21  avi_->adj_ += adj_ / (stan::math::LOG_10 * exp_val_);
22  }
23  };
24  }
25 
55  inline var log10(const var& a) {
56  return var(new log10_vari(a.vi_));
57  }
58 
59  }
60 }
61 #endif
const double LOG_10
The natural logarithm of 10, .
Definition: constants.hpp:38
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:40
const double exp_val_
Definition: log10.hpp:15
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:27
fvar< T > log10(const fvar< T > &x)
Definition: log10.hpp:15

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