All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
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/prim/mat/fun/Eigen.hpp>
#include <limits>
namespace Eigen {
template <typename T>
struct NumTraits<stan::math::fvar<T> > {
typedef stan::math::fvar<T> Real;
typedef stan::math::fvar<T> NonInteger;
typedef stan::math::fvar<T> Nested;
inline static Real epsilon() {
return std::numeric_limits<double>::epsilon();
}
inline static Real dummy_precision() {
return 1e-12; // copied from NumTraits.h values for double
}
inline static Real highest() {
return std::numeric_limits<double>::max();
}
inline static Real lowest() {
return -std::numeric_limits<double>::max();
}
enum {
IsInteger = 0,
IsSigned = 1,
IsComplex = 0,
RequireInitialization = 1,
ReadCost = 1,
AddCost = 1,
MulCost = 1,
HasFloatingPoint = 1
};
};
namespace internal {
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
Eigen::NumTraits< stan::math::fvar< T > >::NonInteger
stan::math::fvar< T > NonInteger
Non-integer valued variables.
Definition: Eigen_NumTraits.hpp:28
core.hpp
Eigen::internal::significant_decimals_default_impl< stan::math::fvar< T >, false >::run
static int run()
Definition: Eigen_NumTraits.hpp:96
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
Eigen::NumTraits< stan::math::fvar< T > >::dummy_precision
static Real dummy_precision()
Return dummy precision.
Definition: Eigen_NumTraits.hpp:50
Eigen::NumTraits< stan::math::fvar< T > >::highest
static Real highest()
Return standard library's highest for double-precision floating point, std::numeric_limits<double>max...
Definition: Eigen_NumTraits.hpp:60
Eigen::NumTraits< stan::math::fvar< T > >::lowest
static Real lowest()
Return standard library's lowest for double-precision floating point, &#45;std::numeric_limits<double...
Definition: Eigen_NumTraits.hpp:70
Eigen::NumTraits< stan::math::fvar< T > >::Real
stan::math::fvar< T > Real
Real-valued variables.
Definition: Eigen_NumTraits.hpp:21
Eigen::NumTraits< stan::math::fvar< T > >::Nested
stan::math::fvar< T > Nested
Nested variables.
Definition: Eigen_NumTraits.hpp:35
Eigen.hpp
stan::math::max
int max(const std::vector< int > &x)
Returns the maximum coefficient in the specified column vector.
Definition: max.hpp:21
stan::math::e
double e()
Return the base of the natural logarithm.
Definition: constants.hpp:95
Eigen::NumTraits< stan::math::fvar< T > >::epsilon
static Real epsilon()
Return standard library's epsilon for double-precision floating point, std::numeric_limits<double>::e...
Definition: Eigen_NumTraits.hpp:43
stan::math::ceil
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11
stan::math::fvar
Definition: fvar.hpp:13

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