dune-common  2.2.0
precision.hh
Go to the documentation of this file.
1 #ifndef DUNE_PRECISION_HH
2 #define DUNE_PRECISION_HH
3 
8 #include <stdlib.h>
9 
10 namespace Dune {
11 
20  template <class ctype = double>
22  public:
24  static ctype pivoting_limit ()
25  {
26  return _pivoting;
27  }
28 
30  static void set_pivoting_limit (ctype pivthres)
31  {
32  _pivoting = pivthres;
33  }
34 
36  static ctype singular_limit ()
37  {
38  return _singular;
39  }
40 
42  static void set_singular_limit (ctype singthres)
43  {
44  _singular = singthres;
45  }
46 
48  static ctype absolute_limit ()
49  {
50  return _absolute;
51  }
52 
54  static void set_absolute_limit (ctype absthres)
55  {
56  _absolute = absthres;
57  }
58 
59  private:
60  // just to demonstrate some state information
61  static ctype _pivoting;
62  static ctype _singular;
63  static ctype _absolute;
64  };
65 
66  template <class ctype>
67  ctype FMatrixPrecision<ctype>::_pivoting = 1E-8;
68  template <class ctype>
69  ctype FMatrixPrecision<ctype>::_singular = 1E-14;
70  template <class ctype>
71  ctype FMatrixPrecision<ctype>::_absolute = 1E-80;
72 
75 } // end namespace
76 
77 #endif