1 #ifndef STAN_MATH_REV_SCAL_FUN_TGAMMA_HPP 2 #define STAN_MATH_REV_SCAL_FUN_TGAMMA_HPP 12 class tgamma_vari :
public op_v_vari {
14 explicit tgamma_vari(vari* avi) :
15 op_v_vari(
tgamma(avi->val_), avi) {
18 avi_->adj_ += adj_ * val_ *
digamma(avi_->val_);
62 return var(
new tgamma_vari(a.
vi_));
Independent (input) and dependent (output) variables for gradients.
vari * vi_
Pointer to the implementation of this variable.
fvar< T > tgamma(const fvar< T > &x)
Return the result of applying the gamma function to the specified argument.
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.