3#ifndef DUNE_GMPFIELD_HH
4#define DUNE_GMPFIELD_HH
19 template<
unsigned int precision >
23 typedef mpf_class Base;
31 GMPField (
const T &v )
44 operator double ()
const
49 operator float ()
const
57 template<
unsigned int precision >
58 inline GMPField< precision >
59 operator+ (
const GMPField< precision > &a,
const GMPField< precision > &b )
62 return ((
const F &)a + (
const F &)b);
65 template<
unsigned int precision >
66 inline GMPField< precision >
67 operator- (
const GMPField< precision > &a,
const GMPField< precision > &b )
70 return ((
const F &)a - (
const F &)b);
73 template<
unsigned int precision >
74 inline GMPField< precision >
75 operator- (
const GMPField< precision > &a )
78 return -((
const F &)a);
81 template<
unsigned int precision >
82 inline GMPField< precision >
83 operator* (
const GMPField< precision > &a,
const GMPField< precision > &b )
86 return ((
const F &)a * (
const F &)b);
89 template<
unsigned int precision >
90 inline GMPField< precision >
91 operator/ (
const GMPField< precision > &a,
const GMPField< precision > &b )
94 return ((
const F &)a / (
const F &)b);
99 template<
unsigned int precision >
100 inline std::ostream &
101 operator<< ( std::ostream &out,
const GMPField< precision > &value )
103 return out << static_cast<const mpf_class&>(value);
111 template<
unsigned int precision >
112 inline Dune::GMPField< precision >
113 sqrt (
const Dune::GMPField< precision > &a )
115 return Dune::GMPField< precision >(sqrt(
static_cast<const mpf_class&
>(a)));
118 template<
unsigned int precision >
119 inline Dune::GMPField< precision >
120 abs (
const Dune::GMPField< precision > &a )
122 return Dune::GMPField< precision >( abs(
static_cast< const mpf_class &
>( a ) ) );
std::ostream & operator<<(std::ostream &s, const array< T, N > &e)
Output operator for array.
Definition: array.hh:159
Dune namespace.
Definition: alignment.hh:14