Stan Math Library  2.20.0
reverse mode automatic differentiation
std_numeric_limits.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_CORE_STD_NUMERIC_LIMITS_HPP
2 #define STAN_MATH_FWD_CORE_STD_NUMERIC_LIMITS_HPP
3 
5 #include <limits>
6 
7 namespace std {
8 
9 template <typename T>
10 struct numeric_limits<stan::math::fvar<T> > {
11  static const bool is_specialized;
12  static constexpr stan::math::fvar<T> min() {
14  }
15  static constexpr stan::math::fvar<T> max() {
17  }
18  static const int digits;
19  static const int digits10;
20  static const bool is_signed;
21  static const bool is_integer;
22  static const bool is_exact;
23  static const int radix;
24  static constexpr stan::math::fvar<T> epsilon() {
25  return numeric_limits<double>::epsilon();
26  }
27  static constexpr stan::math::fvar<T> round_error() {
28  return numeric_limits<double>::round_error();
29  }
30 
31  static const int min_exponent;
32  static const int min_exponent10;
33  static const int max_exponent;
34  static const int max_exponent10;
35 
36  static const bool has_infinity;
37  static const bool has_quiet_NaN;
38  static const bool has_signaling_NaN;
39 
40  static const float_denorm_style has_denorm;
41  static const bool has_denorm_loss;
42  static constexpr stan::math::fvar<T> infinity() {
43  return numeric_limits<double>::infinity();
44  }
45  static constexpr stan::math::fvar<T> quiet_NaN() {
46  return numeric_limits<double>::quiet_NaN();
47  }
48  static constexpr stan::math::fvar<T> signaling_NaN() {
49  return numeric_limits<double>::signaling_NaN();
50  }
51  static constexpr stan::math::fvar<T> denorm_min() {
52  return numeric_limits<double>::denorm_min();
53  }
54 
55  static const bool is_iec559;
56  static const bool is_bounded;
57  static const bool is_modulo;
58 
59  static const bool traps;
60  static const bool tinyness_before;
61  static const float_round_style round_style;
62 };
63 
64 template <typename T>
65 const bool numeric_limits<stan::math::fvar<T> >::is_specialized = true;
66 template <typename T>
67 const int numeric_limits<stan::math::fvar<T> >::digits
68  = numeric_limits<double>::digits;
69 template <typename T>
70 const int numeric_limits<stan::math::fvar<T> >::digits10
71  = numeric_limits<double>::digits10;
72 template <typename T>
73 const bool numeric_limits<stan::math::fvar<T> >::is_signed
74  = numeric_limits<double>::is_signed;
75 template <typename T>
76 const bool numeric_limits<stan::math::fvar<T> >::is_integer
78 template <typename T>
79 const bool numeric_limits<stan::math::fvar<T> >::is_exact
80  = numeric_limits<double>::is_exact;
81 template <typename T>
82 const int numeric_limits<stan::math::fvar<T> >::radix
83  = numeric_limits<double>::radix;
84 template <typename T>
85 const int numeric_limits<stan::math::fvar<T> >::min_exponent
86  = numeric_limits<double>::min_exponent;
87 template <typename T>
88 const int numeric_limits<stan::math::fvar<T> >::min_exponent10
89  = numeric_limits<double>::min_exponent10;
90 template <typename T>
91 const int numeric_limits<stan::math::fvar<T> >::max_exponent
92  = numeric_limits<double>::max_exponent;
93 template <typename T>
94 const int numeric_limits<stan::math::fvar<T> >::max_exponent10
95  = numeric_limits<double>::max_exponent10;
96 
97 template <typename T>
98 const bool numeric_limits<stan::math::fvar<T> >::has_infinity
99  = numeric_limits<double>::has_infinity;
100 template <typename T>
101 const bool numeric_limits<stan::math::fvar<T> >::has_quiet_NaN
102  = numeric_limits<double>::has_quiet_NaN;
103 template <typename T>
104 const bool numeric_limits<stan::math::fvar<T> >::has_signaling_NaN
105  = numeric_limits<double>::has_signaling_NaN;
106 template <typename T>
107 const float_denorm_style numeric_limits<stan::math::fvar<T> >::has_denorm
108  = numeric_limits<double>::has_denorm;
109 template <typename T>
110 const bool numeric_limits<stan::math::fvar<T> >::has_denorm_loss
111  = numeric_limits<double>::has_denorm_loss;
112 
113 template <typename T>
114 const bool numeric_limits<stan::math::fvar<T> >::is_iec559
115  = numeric_limits<double>::is_iec559;
116 template <typename T>
117 const bool numeric_limits<stan::math::fvar<T> >::is_bounded
118  = numeric_limits<double>::is_bounded;
119 template <typename T>
120 const bool numeric_limits<stan::math::fvar<T> >::is_modulo
121  = numeric_limits<double>::is_modulo;
122 
123 template <typename T>
124 const bool numeric_limits<stan::math::fvar<T> >::traps
125  = numeric_limits<double>::traps;
126 template <typename T>
127 const bool numeric_limits<stan::math::fvar<T> >::tinyness_before
128  = numeric_limits<double>::tinyness_before;
129 template <typename T>
130 const float_round_style numeric_limits<stan::math::fvar<T> >::round_style
131  = numeric_limits<double>::round_style;
132 
133 } // namespace std
134 #endif
static constexpr stan::math::fvar< T > denorm_min()
static const float_denorm_style has_denorm
int min(const std::vector< int > &x)
Returns the minimum coefficient in the specified column vector.
Definition: min.hpp:20
static constexpr stan::math::fvar< T > quiet_NaN()
static constexpr stan::math::fvar< T > epsilon()
static constexpr stan::math::fvar< T > max()
static constexpr stan::math::fvar< T > round_error()
int max(const std::vector< int > &x)
Returns the maximum coefficient in the specified column vector.
Definition: max.hpp:21
static constexpr stan::math::fvar< T > signaling_NaN()
static constexpr stan::math::fvar< T > min()
bool is_integer(T x)
Returns true if the input is an integer and false otherwise.
Definition: is_integer.hpp:17
static constexpr stan::math::fvar< T > infinity()
This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type.
Definition: fvar.hpp:41

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