dune-common  2.2.1
math.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=4 sts=2:
3 #ifndef DUNE_MATH_HH
4 #define DUNE_MATH_HH
5 
10 #include <cmath>
11 
12 namespace Dune
13 {
14 
22  template< class Field >
24 
35  template< class T >
37  {
38  static T e ()
39  {
40  static const T e = std::exp( T( 1 ) );
41  return e;
42  }
43 
44  static T pi ()
45  {
46  static const T pi = std::acos( T( -1 ) );
47  return pi;
48  }
49  };
50 
51 
52 #ifndef DOXYGEN
53  // MathematicalConstants for float
54  // -------------------------------
55 
56  template<>
57  struct MathematicalConstants< float >
58  : public StandardMathematicalConstants< float >
59  {};
60 
61 
62 
63  // MathematicalConstants for double
64  // --------------------------------
65 
66  template<>
67  struct MathematicalConstants< double >
68  : public StandardMathematicalConstants< double >
69  {};
70 
71 
72 
73  // MathematicalConstants for long double
74  // -------------------------------------
75 
76  template<>
77  struct MathematicalConstants< long double >
78  : public StandardMathematicalConstants< long double >
79  {};
80 #endif // DOXYGEN
81 
82 }
83 
84 #endif // #ifndef DUNE_MATH_HH