| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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>
5 #include <stan/math/fwd/core/std_numeric_limits.hpp>
6 #include <stan/math/prim/mat/fun/Eigen.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
core.hpp
stan
Definition: log_sum_exp.hpp:8
Eigen::internal::significant_decimals_default_impl< stan::math::fvar< T >, false >::run
static int run()
Definition: Eigen_NumTraits.hpp:41
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
Eigen
(Expert) Numerical traits for algorithmic differentiation variables.
Definition: Eigen_NumTraits.hpp:9
Eigen.hpp
std_numeric_limits.hpp
stan::math::ceil
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11

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