Stan Math Library  2.20.0
reverse mode automatic differentiation
operator_unary_plus.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_OPERATOR_UNARY_PLUS_HPP
2 #define STAN_MATH_REV_CORE_OPERATOR_UNARY_PLUS_HPP
3 
8 
9 namespace stan {
10 namespace math {
11 
43 inline var operator+(const var& a) {
44  if (unlikely(is_nan(a.vi_->val_)))
46  return a;
47 }
48 
49 } // namespace math
50 } // namespace stan
51 #endif
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:58
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:33
const double val_
The value of this variable.
Definition: vari.hpp:38
#define unlikely(x)
Definition: likely.hpp:9
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:45
fvar< T > operator+(const fvar< T > &x1, const fvar< T > &x2)
Return the sum of the specified forward mode addends.
int is_nan(const fvar< T > &x)
Returns 1 if the input&#39;s value is NaN and 0 otherwise.
Definition: is_nan.hpp:20

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