dune-common
2.2.0
|
00001 #ifndef DUNE_PRECISION_HH 00002 #define DUNE_PRECISION_HH 00003 00008 #include <stdlib.h> 00009 00010 namespace Dune { 00011 00020 template <class ctype = double> 00021 class FMatrixPrecision { 00022 public: 00024 static ctype pivoting_limit () 00025 { 00026 return _pivoting; 00027 } 00028 00030 static void set_pivoting_limit (ctype pivthres) 00031 { 00032 _pivoting = pivthres; 00033 } 00034 00036 static ctype singular_limit () 00037 { 00038 return _singular; 00039 } 00040 00042 static void set_singular_limit (ctype singthres) 00043 { 00044 _singular = singthres; 00045 } 00046 00048 static ctype absolute_limit () 00049 { 00050 return _absolute; 00051 } 00052 00054 static void set_absolute_limit (ctype absthres) 00055 { 00056 _absolute = absthres; 00057 } 00058 00059 private: 00060 // just to demonstrate some state information 00061 static ctype _pivoting; 00062 static ctype _singular; 00063 static ctype _absolute; 00064 }; 00065 00066 template <class ctype> 00067 ctype FMatrixPrecision<ctype>::_pivoting = 1E-8; 00068 template <class ctype> 00069 ctype FMatrixPrecision<ctype>::_singular = 1E-14; 00070 template <class ctype> 00071 ctype FMatrixPrecision<ctype>::_absolute = 1E-80; 00072 00075 } // end namespace 00076 00077 #endif