log10.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_SCAL_FUN_LOG10_HPP
#define STAN_MATH_REV_SCAL_FUN_LOG10_HPP
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
#include <cmath>
namespace stan {
namespace math {
namespace {
class log10_vari : public op_v_vari {
public:
const double exp_val_;
explicit log10_vari(vari* avi) :
op_v_vari(std::log10(avi->val_), avi),
exp_val_(avi->val_) {
}
void chain() {
avi_->adj_ += adj_ / (LOG_10 * exp_val_);
}
};
}
inline var log10(const var& a) {
return var(new log10_vari(a.vi_));
}
}
}
#endif
core.hpp
stan
Definition: log_sum_exp.hpp:8
std
Definition: std_numeric_limits.hpp:7
stan::math::LOG_10
const double LOG_10
The natural logarithm of 10, .
Definition: constants.hpp:38
stan::math::log10
fvar< T > log10(const fvar< T > &x)
Definition: log10.hpp:13
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:30
stan::math::var::vi_
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:42
exp_val_
const double exp_val_
Definition: log10.hpp:14
constants.hpp

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