Stan  1.0
probability, sampling & optimization
error_handling.hpp
Go to the documentation of this file.
1 #ifndef __STAN__AGRAD__ERROR_HANDLING_HPP__
2 #define __STAN__AGRAD__ERROR_HANDLING_HPP__
3 
5 #include <stan/agrad/agrad.hpp>
6 
7 namespace boost {
8 
9  namespace math {
10 
22  template <>
23  inline
25  return boost::math::fpclassify(v.val());
26  }
27 
37  template <>
38  inline
39  bool isfinite(const stan::agrad::var v) {
40  return boost::math::isfinite(v.val());
41  }
42 
52  template <>
53  inline
54  bool isinf(const stan::agrad::var v) {
55  return boost::math::isinf(v.val());
56  }
57 
67  template <>
68  inline
69  bool isnan(const stan::agrad::var v) {
70  return boost::math::isnan(v.val());
71  }
72 
82  template <>
83  inline
84  bool isnormal(const stan::agrad::var v) {
85  return boost::math::isnormal(v.val());
86  }
87 
88  }
89 }
90 
91 #endif
92 
Independent (input) and dependent (output) variables for gradients.
Definition: agrad.hpp:214
double val() const
Return the value of this variable.
Definition: agrad.hpp:396
bool isfinite(const stan::agrad::var v)
Checks if the given number has finite value.
bool isnormal(const stan::agrad::var v)
Checks if the given number is normal.
int fpclassify(const stan::agrad::var v)
Categorizes the given stan::agrad::var value.
bool isnan(const stan::agrad::var v)
Checks if the given number is NaN.
bool isinf(const stan::agrad::var v)
Checks if the given number is infinite.
Reimplementing boost functionality.

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