Stan Math Library  2.20.0
reverse mode automatic differentiation
operator_logical_or.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_CORE_OPERATOR_LOGICAL_OR_HPP
2 #define STAN_MATH_REV_CORE_OPERATOR_LOGICAL_OR_HPP
3 
5 
6 namespace stan {
7 namespace math {
8 
17 inline bool operator||(const var& x, const var& y) {
18  return x.val() || y.val();
19 }
20 
30 template <typename T>
31 inline bool operator||(const var& x, double y) {
32  return x.val() || y;
33 }
34 
44 template <typename T>
45 inline bool operator||(double x, const var& y) {
46  return x || y.val();
47 }
48 
49 } // namespace math
50 } // namespace stan
51 #endif
bool operator||(const fvar< T > &x, const fvar< T > &y)
Return the logical disjunction of the values of the two arguments as defined by ||.
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:33
double val() const
Return the value of this variable.
Definition: var.hpp:294

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