Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef QHFUNCTIONOBJECTS_H
00010 #define QHFUNCTIONOBJECTS_H
00011
00012 #include <stdlib.h>
00013 #include <math.h>
00014
00015 namespace orgQhull {
00016 #//Type
00017
00019 class AbsoluteSumOf;
00021 class SumOf;
00023 class SumSquaresOf;
00024
00025 #//Class
00026
00028 class AbsoluteSumOf
00029 {
00030 private:
00031 double sum;
00032 public:
00033 inline AbsoluteSumOf() : sum(0.0) {}
00034 inline void operator()(double v) { sum += fabs(v); }
00035 inline operator double() { return sum; }
00036 };
00037
00039 class SumOf
00040 {
00041 private:
00042 double sum;
00043 public:
00044 inline SumOf() : sum(0.0) {}
00045 inline void operator()(double v) { sum += v; }
00046 inline operator double() { return sum; }
00047 };
00048
00049
00051 class SumSquaresOf
00052 {
00053 private:
00054 double sum;
00055 public:
00056 inline SumSquaresOf() : sum(0.0) {}
00057 inline void operator()(double v) { sum += v*v; }
00058 inline operator double() { return sum; }
00059 };
00060
00061
00062 }
00063
00064
00065 #endif //QHFUNCTIONOBJECTS_H
00066