Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

DoubleMinmod.hpp

00001 #ifndef _DoubleMinmod_H
00002 #define _DoubleMinmod_H
00003 
00004 
00005 
00058 #include <math.h>
00059 
00060 
00061 class DoubleMinmod : public AbsLimiter
00062 {
00063 protected:
00064 
00065 double minmod(double a, double b)
00066         {
00067         double val=0.0;
00068 
00069         if( (a*b) > 0.0 )
00070                 val= fabs(a) <= fabs(b) ? a : b;
00071 
00072         return val;
00073         }
00074 
00075 double maxmod(double a, double b)
00076         {
00077         double val=0.0;
00078 
00079         if( (a*b) > 0.0 )
00080                 val= fabs(a) >= fabs(b) ? a : b;
00081 
00082         return val;
00083         }
00084 
00085 public:
00086 virtual ~DoubleMinmod(){}
00087 
00088 
00089 virtual double average(double a, double b)
00090         {
00091         double val=0.0;
00092 
00093         if( (a*b) > 0.0 )
00094                 val= minmod( 0.5*(maxmod(a,b)+minmod(a,b)), minmod(2.0*a,2.0*b) );
00095 
00096         return val;
00097         }
00098 };
00099 
00100 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com