00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __Atlfast_SimpleTestStatisticAbsDiff__
00017 #define __Atlfast_SimpleTestStatisticAbsDiff__
00018 #include <string>
00019 #include <cmath>
00020 #include "AtlfastCode/SimpleTestStatistic.h"
00021 namespace Atlfast {
00025 class SimpleTestStatisticAbsDiff{
00026 public:
00027
00028 SimpleTestStatisticAbsDiff(const SimpleTestStatistic* s):
00029 m_val( s->val()){}
00030
00031 SimpleTestStatisticAbsDiff(const SimpleTestStatistic* const * const s):
00032 m_val( (*s)->val()){}
00033
00034 bool operator()(const SimpleTestStatistic s, const SimpleTestStatistic t)
00035 {
00036 return ( abs(s.val()-m_val) < abs(t.val()-m_val) );
00037 }
00038
00039 bool operator()(const SimpleTestStatistic* const s,
00040 const SimpleTestStatistic* const t) {
00041 return ( abs(s->val()-m_val) < abs(t->val()-m_val) );
00042 }
00043
00044 bool operator()(const SimpleTestStatistic** const s,
00045 const SimpleTestStatistic** const t) {
00046 return ( abs( (*s)->val()-m_val) < abs((*t)->val()-m_val) );
00047 }
00048 private:
00049 const double m_val;
00050 };
00051 }
00052 #endif
00053
00054