Stan Math Library  2.8.0
reverse mode automatic differentiation
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
Eigen_NumTraits.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_MAT_FUN_EIGEN_NUMTRAITS_HPP
2 #define STAN_MATH_FWD_MAT_FUN_EIGEN_NUMTRAITS_HPP
3 
4 #include <stan/math/fwd/core.hpp>
6 #include <limits>
7 
8 namespace Eigen {
9 
14  template <typename T>
15  struct NumTraits<stan::math::fvar<T> > {
22 
29 
36 
43  inline static Real epsilon() {
44  return std::numeric_limits<double>::epsilon();
45  }
46 
50  inline static Real dummy_precision() {
51  return 1e-12; // copied from NumTraits.h values for double
52  }
53 
60  inline static Real highest() {
62  }
63 
70  inline static Real lowest() {
72  }
73 
78  enum {
79  IsInteger = 0,
80  IsSigned = 1,
81  IsComplex = 0,
82  RequireInitialization = 1,
83  ReadCost = 1,
84  AddCost = 1,
85  MulCost = 1,
86  HasFloatingPoint = 1
87  };
88  };
89 
90  namespace internal {
94  template<typename T>
95  struct significant_decimals_default_impl<stan::math::fvar<T>, false> {
96  static inline int run() {
97  using std::ceil;
98  using std::log;
99  return cast<double, int>
100  (ceil(-log(std::numeric_limits<double>::epsilon())
101  / log(10.0)));
102  }
103  };
104 
105  }
106 }
107 
108 #endif
stan::math::fvar< T > NonInteger
Non-integer valued variables.
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
static Real dummy_precision()
Return dummy precision.
static Real highest()
Return standard library's highest for double-precision floating point, std::numeric_limits<double>max...
static Real lowest()
Return standard library's lowest for double-precision floating point, &#45;std::numeric_limits<double...
stan::math::fvar< T > Real
Real-valued variables.
stan::math::fvar< T > Nested
Nested variables.
int max(const std::vector< int > &x)
Returns the maximum coefficient in the specified column vector.
Definition: max.hpp:21
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:95
static Real epsilon()
Return standard library's epsilon for double-precision floating point, std::numeric_limits<double>::e...
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11

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