precision.hh

00001 #ifndef DUNE_PRECISION_HH
00002 #define DUNE_PRECISION_HH
00003 
00004 #include <stdlib.h>
00005 
00006 namespace Dune {
00007    
00016   template <class ctype = double>
00017   class FMatrixPrecision {
00018   public:
00020         static ctype pivoting_limit ()
00021         {
00022           return _pivoting;
00023         }
00024 
00026         static void set_pivoting_limit (ctype pivthres)
00027         {
00028           _pivoting = pivthres;
00029         }
00030 
00032         static ctype singular_limit ()
00033         {
00034           return _singular;
00035         }
00036 
00038         static void set_singular_limit (ctype singthres)
00039         {
00040           _singular = singthres;
00041         }
00042 
00044         static ctype absolute_limit ()
00045         {
00046           return _absolute;
00047         }
00048 
00050         static void set_absolute_limit (ctype absthres)
00051         {
00052           _absolute = absthres;
00053         }
00054 
00055   private:
00056         // just to demonstrate some state information
00057         static ctype _pivoting;
00058         static ctype _singular;
00059         static ctype _absolute;
00060   };
00061 
00062   template <class ctype>
00063   ctype FMatrixPrecision<ctype>::_pivoting = 1E-8;
00064   template <class ctype>
00065   ctype FMatrixPrecision<ctype>::_singular = 1E-14;
00066   template <class ctype>
00067   ctype FMatrixPrecision<ctype>::_absolute = 1E-80;
00068  
00071 } // end namespace
00072 
00073 #endif

Generated on 12 Dec 2007 with Doxygen (ver 1.5.1)