Stan Math Library  2.12.0
reverse mode automatic differentiation
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>
7 #include <limits>
8 
9 namespace Eigen {
10 
15  template <typename T>
16  struct NumTraits<stan::math::fvar<T> >
17  : GenericNumTraits<stan::math::fvar<T> > {
18 
19  enum {
20  RequireInitialization = 1,
22  ReadCost = 2 * NumTraits<double>::ReadCost,
24  AddCost = 2 * NumTraits<T>::AddCost,
28  MulCost = 3 * NumTraits<T>::MulCost + NumTraits<T>::AddCost
32  };
33  };
34 
35  namespace internal {
39  template<typename T>
40  struct significant_decimals_default_impl<stan::math::fvar<T>, false> {
41  static inline int run() {
42  using std::ceil;
43  using std::log;
44  return cast<double, int>
45  (ceil(-log(std::numeric_limits<double>::epsilon())
46  / log(10.0)));
47  }
48  };
49 
50  }
51 }
52 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
(Expert) Numerical traits for algorithmic differentiation variables.
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11

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