00001
00002
00003 #ifndef DUNE_PRECISION_HH
00004 #define DUNE_PRECISION_HH
00005
00010 #include <stdlib.h>
00011
00012 namespace Dune {
00013
00022 template <class ctype = double>
00023 class FMatrixPrecision {
00024 public:
00026 static ctype pivoting_limit ()
00027 {
00028 return _pivoting;
00029 }
00030
00032 static void set_pivoting_limit (ctype pivthres)
00033 {
00034 _pivoting = pivthres;
00035 }
00036
00038 static ctype singular_limit ()
00039 {
00040 return _singular;
00041 }
00042
00044 static void set_singular_limit (ctype singthres)
00045 {
00046 _singular = singthres;
00047 }
00048
00050 static ctype absolute_limit ()
00051 {
00052 return _absolute;
00053 }
00054
00056 static void set_absolute_limit (ctype absthres)
00057 {
00058 _absolute = absthres;
00059 }
00060
00061 private:
00062
00063 static ctype _pivoting;
00064 static ctype _singular;
00065 static ctype _absolute;
00066 };
00067
00068 template <class ctype>
00069 ctype FMatrixPrecision<ctype>::_pivoting = 1E-8;
00070 template <class ctype>
00071 ctype FMatrixPrecision<ctype>::_singular = 1E-14;
00072 template <class ctype>
00073 ctype FMatrixPrecision<ctype>::_absolute = 1E-80;
00074
00077 }
00078
00079 #endif