Automatic Differentiation
 
Loading...
Searching...
No Matches
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
7namespace std {
8
9template <typename T>
10struct numeric_limits<stan::math::fvar<T> > {
11 static const bool is_specialized;
12 static constexpr stan::math::fvar<T> min() {
13 return numeric_limits<double>::min();
14 }
15 static constexpr stan::math::fvar<T> max() {
16 return numeric_limits<double>::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 static constexpr int max_digits10{numeric_limits<T>::max_digits10};
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 }
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
64template <typename T>
65const bool numeric_limits<stan::math::fvar<T> >::is_specialized = true;
66template <typename T>
67const int numeric_limits<stan::math::fvar<T> >::digits
68 = numeric_limits<double>::digits;
69template <typename T>
70const int numeric_limits<stan::math::fvar<T> >::digits10
71 = numeric_limits<double>::digits10;
72template <typename T>
73const bool numeric_limits<stan::math::fvar<T> >::is_signed
74 = numeric_limits<double>::is_signed;
75template <typename T>
76const bool numeric_limits<stan::math::fvar<T> >::is_integer
77 = numeric_limits<double>::is_integer;
78template <typename T>
79const bool numeric_limits<stan::math::fvar<T> >::is_exact
80 = numeric_limits<double>::is_exact;
81template <typename T>
82const int numeric_limits<stan::math::fvar<T> >::radix
83 = numeric_limits<double>::radix;
84template <typename T>
85const int numeric_limits<stan::math::fvar<T> >::min_exponent
86 = numeric_limits<double>::min_exponent;
87template <typename T>
88const int numeric_limits<stan::math::fvar<T> >::min_exponent10
89 = numeric_limits<double>::min_exponent10;
90template <typename T>
91const int numeric_limits<stan::math::fvar<T> >::max_exponent
92 = numeric_limits<double>::max_exponent;
93template <typename T>
94const int numeric_limits<stan::math::fvar<T> >::max_exponent10
95 = numeric_limits<double>::max_exponent10;
96
97template <typename T>
98const bool numeric_limits<stan::math::fvar<T> >::has_infinity
99 = numeric_limits<double>::has_infinity;
100template <typename T>
101const bool numeric_limits<stan::math::fvar<T> >::has_quiet_NaN
102 = numeric_limits<double>::has_quiet_NaN;
103template <typename T>
104const bool numeric_limits<stan::math::fvar<T> >::has_signaling_NaN
105 = numeric_limits<double>::has_signaling_NaN;
106template <typename T>
107const float_denorm_style numeric_limits<stan::math::fvar<T> >::has_denorm
108 = numeric_limits<double>::has_denorm;
109template <typename T>
110const bool numeric_limits<stan::math::fvar<T> >::has_denorm_loss
111 = numeric_limits<double>::has_denorm_loss;
112
113template <typename T>
114const bool numeric_limits<stan::math::fvar<T> >::is_iec559
115 = numeric_limits<double>::is_iec559;
116template <typename T>
117const bool numeric_limits<stan::math::fvar<T> >::is_bounded
118 = numeric_limits<double>::is_bounded;
119template <typename T>
120const bool numeric_limits<stan::math::fvar<T> >::is_modulo
121 = numeric_limits<double>::is_modulo;
122
123template <typename T>
124const bool numeric_limits<stan::math::fvar<T> >::traps
125 = numeric_limits<double>::traps;
126template <typename T>
127const bool numeric_limits<stan::math::fvar<T> >::tinyness_before
128 = numeric_limits<double>::tinyness_before;
129template <typename T>
130const float_round_style numeric_limits<stan::math::fvar<T> >::round_style
131 = numeric_limits<double>::round_style;
132
133} // namespace std
134#endif
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
STL namespace.
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40
static constexpr stan::math::fvar< T > denorm_min()
static constexpr stan::math::fvar< T > min()
static constexpr stan::math::fvar< T > max()
static constexpr stan::math::fvar< T > signaling_NaN()
static constexpr stan::math::fvar< T > infinity()
static constexpr stan::math::fvar< T > epsilon()
static constexpr stan::math::fvar< T > round_error()
static constexpr stan::math::fvar< T > quiet_NaN()