Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
constants.hpp
Go to the documentation of this file.
1 #ifndef __STAN__MATH__CONSTANTS_HPP__
2 #define __STAN__MATH__CONSTANTS_HPP__
3 
4 #include <boost/math/constants/constants.hpp>
5 
6 namespace stan {
7 
8  namespace math {
9 
14  const double E = boost::math::constants::e<double>();
15 
20  const double SQRT_2 = std::sqrt(2.0);
21 
26  const double INV_SQRT_2 = 1.0 / SQRT_2;
27 
32  const double LOG_2 = std::log(2.0);
33 
38  const double LOG_10 = std::log(10.0);
39 
43  const double INFTY = std::numeric_limits<double>::infinity();
44 
48  const double NEGATIVE_INFTY = - std::numeric_limits<double>::infinity();
49 
53  const double NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN();
54 
59 
64 
65 
66  /*
67  * Log pi divided by 4
68  * \f$ \log \pi / 4 \f$
69  */
70  const double LOG_PI_OVER_FOUR = std::log(boost::math::constants::pi<double>()) / 4.0;
71 
77  inline double pi() {
78  return boost::math::constants::pi<double>();
79  }
80 
86  inline double e() {
87  return E;
88  }
89 
95  inline double sqrt2() {
96  return SQRT_2;
97  }
98 
99 
105  inline double log10() {
106  return LOG_10;
107  }
108 
114  inline double positive_infinity() {
115  return INFTY;
116  }
117 
123  inline double negative_infinity() {
124  return NEGATIVE_INFTY;
125  }
126 
132  inline double not_a_number() {
133  return NOT_A_NUMBER;
134  }
135 
141  inline double epsilon() {
142  return EPSILON;
143  }
144 
151  inline double negative_epsilon() {
152  return NEGATIVE_EPSILON;
153  }
154 
155  const double TWO_OVER_SQRT_PI = 2.0 / std::sqrt(boost::math::constants::pi<double>());
156 
158 
159  const double INV_SQRT_TWO_PI = 1.0 / std::sqrt(2.0 * boost::math::constants::pi<double>());
160 
161  }
162 }
163 
164 #endif

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