3#ifndef DUNE_GMPFIELD_HH
4#define DUNE_GMPFIELD_HH
14#if HAVE_GMP || DOXYGEN
28 template<
unsigned int precision >
32 typedef mpf_class Base;
57 typename EnableIf =
typename std::enable_if<
58 std::is_convertible<T, mpf_class>::value>::type
65 operator double ()
const
72 template <
unsigned int precision>
73 struct IsNumber<GMPField<precision>>
74 :
public std::integral_constant<bool, true> {
77 template<
unsigned int precision1,
unsigned int precision2 >
78 struct PromotionTraits<GMPField<precision1>, GMPField<precision2>>
80 typedef GMPField<(precision1 > precision2 ? precision1 : precision2)> PromotedType;
83 template<
unsigned int precision >
84 struct PromotionTraits<GMPField<precision>,GMPField<precision>>
86 typedef GMPField<precision> PromotedType;
89 template<
unsigned int precision,
class T >
90 struct PromotionTraits<GMPField<precision>, T>
92 typedef GMPField<precision> PromotedType;
95 template<
class T,
unsigned int precision >
96 struct PromotionTraits<T, GMPField<precision>>
98 typedef GMPField<precision> PromotedType;
Number class for high precision floating point number using the GMP library mpf_class implementation.
Definition: gmpfield.hh:31
GMPField(const T &v)
initialize from a compatible scalar type
Definition: gmpfield.hh:60
GMPField()
Definition: gmpfield.hh:36
GMPField(const std::string &str)
initialize from a string
Definition: gmpfield.hh:50
GMPField(const char *str)
initialize from a string
Definition: gmpfield.hh:43
Traits for type conversions and type information.
Dune namespace.
Definition: alignedallocator.hh:11