File indexing completed on 2025-01-18 10:01:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef QHFUNCTIONOBJECTS_H
0010 #define QHFUNCTIONOBJECTS_H
0011
0012 #include <stdlib.h>
0013 #include <math.h>
0014
0015 namespace orgQhull {
0016
0017 #
0018
0019
0020 class AbsoluteSumOf;
0021
0022 class SumOf;
0023
0024 class SumSquaresOf;
0025
0026 #
0027
0028
0029 class AbsoluteSumOf
0030 {
0031 private:
0032 double sum;
0033 public:
0034 inline AbsoluteSumOf() : sum(0.0) {}
0035 inline void operator()(double v) { sum += fabs(v); }
0036 inline operator double() { return sum; }
0037 };
0038
0039
0040 class SumOf
0041 {
0042 private:
0043 double sum;
0044 public:
0045 inline SumOf() : sum(0.0) {}
0046 inline void operator()(double v) { sum += v; }
0047 inline operator double() { return sum; }
0048 };
0049
0050
0051
0052 class SumSquaresOf
0053 {
0054 private:
0055 double sum;
0056 public:
0057 inline SumSquaresOf() : sum(0.0) {}
0058 inline void operator()(double v) { sum += v*v; }
0059 inline operator double() { return sum; }
0060 };
0061
0062
0063 }
0064
0065
0066 #endif
0067