Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
as_bool.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__REV__FUNCTIONS__AS_BOOL_HPP
2 #define STAN__AGRAD__REV__FUNCTIONS__AS_BOOL_HPP
3 
4 #include <stan/agrad/rev/var.hpp>
5 
6 namespace stan {
7  namespace agrad {
8 
15  inline int as_bool(const agrad::var& v) {
16  return 0.0 != v.vi_->val_;
17  }
18 
19  }
20 }
21 #endif
const double val_
The value of this variable.
Definition: vari.hpp:37
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:40
int as_bool(const agrad::var &v)
Return 1 if the argument is unequal to zero and 0 otherwise.
Definition: as_bool.hpp:15
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:27

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