All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
operator_unary_plus.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_CORE_OPERATOR_UNARY_PLUS_HPP
#define STAN_MATH_REV_CORE_OPERATOR_UNARY_PLUS_HPP
#include <stan/math/rev/core/var.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <stan/math/rev/core/precomp_v_vari.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
namespace stan {
namespace math {
inline var operator+(const var& a) {
if (unlikely(boost::math::isnan(a.vi_->val_)))
return var(new precomp_v_vari(stan::math::NOT_A_NUMBER,
a.vi_,
stan::math::NOT_A_NUMBER));
return a;
}
}
}
#endif
precomp_v_vari.hpp
stan::math::NOT_A_NUMBER
const double NOT_A_NUMBER
(Quiet) not-a-number value.
Definition: constants.hpp:56
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:32
stan::math::vari::val_
const double val_
The value of this variable.
Definition: vari.hpp:36
boost::math::isnan
bool isnan(const stan::math::var &v)
Checks if the given number is NaN.
Definition: boost_isnan.hpp:22
unlikely
#define unlikely(x)
Definition: likely.hpp:9
stan::math::var::vi_
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:44
var.hpp
stan::math::operator+
fvar< T > operator+(const fvar< T > &x1, const fvar< T > &x2)
Definition: operator_addition.hpp:13
constants.hpp
stan::math::precomp_v_vari
Definition: precomp_v_vari.hpp:11

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