1 #ifndef STAN__AGRAD__REV__OPERATORS__OPERATOR_UNARY_NEGATIVE_HPP
2 #define STAN__AGRAD__REV__OPERATORS__OPERATOR_UNARY_NEGATIVE_HPP
6 #include <boost/math/special_functions/fpclassify.hpp>
12 class neg_vari :
public op_v_vari {
15 op_v_vari(-(avi->val_), avi) {
19 avi_->adj_ = std::numeric_limits<double>::quiet_NaN();
51 return var(
new neg_vari(a.
vi_));
bool isnan(const stan::agrad::var &v)
Checks if the given number is NaN.
fvar< T > operator-(const fvar< T > &x1, const fvar< T > &x2)
vari * vi_
Pointer to the implementation of this variable.
Independent (input) and dependent (output) variables for gradients.