1 #ifndef STAN_MATH_REV_CORE_OPERATOR_UNARY_NEGATIVE_HPP 2 #define STAN_MATH_REV_CORE_OPERATOR_UNARY_NEGATIVE_HPP 13 class neg_vari :
public op_v_vari {
15 explicit neg_vari(vari* avi) :
16 op_v_vari(-(avi->val_), avi) {
20 avi_->adj_ = std::numeric_limits<double>::quiet_NaN();
52 return var(
new neg_vari(a.
vi_));
fvar< T > operator-(const fvar< T > &x1, const fvar< T > &x2)
Independent (input) and dependent (output) variables for gradients.
vari * vi_
Pointer to the implementation of this variable.
int is_nan(const fvar< T > &x)
Returns 1 if the input's value is NaN and 0 otherwise.