Eigen_NumTraits.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_MAT_FUN_EIGEN_NUMTRAITS_HPP
#define STAN_MATH_FWD_MAT_FUN_EIGEN_NUMTRAITS_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/fwd/core/std_numeric_limits.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <limits>
namespace Eigen {
template <typename T>
struct NumTraits<stan::math::fvar<T> >
: GenericNumTraits<stan::math::fvar<T> > {
enum {
RequireInitialization = 1,
ReadCost = 2 * NumTraits<double>::ReadCost,
AddCost = 2 * NumTraits<T>::AddCost,
MulCost = 3 * NumTraits<T>::MulCost + NumTraits<T>::AddCost
};
static int digits10() {
return std::numeric_limits<double>::digits10;
}
};
namespace internal {
#if EIGEN_VERSION_AT_LEAST(3, 3, 0)
#else
template<typename T>
struct significant_decimals_default_impl<stan::math::fvar<T>, false> {
static inline int run() {
using std::ceil;
using std::log;
return cast<double, int>
(ceil(-log(std::numeric_limits<double>::epsilon())
/ log(10.0)));
}
};
#endif
}
}
#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:67
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
Eigen::NumTraits< stan::math::fvar< T > >::digits10
static int digits10()
Return the number of decimal digits that can be represented without change.
Definition: Eigen_NumTraits.hpp:54
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.