1 #ifndef STAN_MATH_REV_SCAL_FUN_LGAMMA_HPP 2 #define STAN_MATH_REV_SCAL_FUN_LGAMMA_HPP 13 class lgamma_vari :
public op_v_vari {
15 lgamma_vari(
double value, vari* avi) :
16 op_v_vari(value, avi) {
19 avi_->adj_ += adj_ *
digamma(avi_->val_);
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
Independent (input) and dependent (output) variables for gradients.
vari * vi_
Pointer to the implementation of this variable.
double val() const
Return the value of this variable.
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.