00001 #ifndef _AbsLimiter_H 00002 #define _AbsLimiter_H 00003 00004 00005 00052 #include <math.h> 00053 #include "RComplex.hpp" 00054 00055 class AbsLimiter 00056 { 00057 protected: 00058 00059 int sign(double a){ if(a==0.0) return 0.0; return (a >= 0.0 ? 1 : -1); } 00060 int minsign(double a, double b){return (fabs(a) <= fabs(b) ? sign(a) : sign(b));} 00061 00062 public: 00063 virtual ~AbsLimiter(){} 00064 00065 virtual double average(double a, double b)=0; 00066 virtual RComplex average(const RComplex& a, const RComplex& b) 00067 { return RComplex( average(a.a,b.a), average(a.b, b.b) ); } 00068 }; 00069 00070 #endif