00001
00002
00003
00004
00005
00006 #ifndef ERF_H
00007 #define ERF_H
00008
00009 #include <cmath>
00010
00011 namespace mimas {
00012
00013 class mm_erf
00014 {
00015 private:
00016 double *vals;
00017 public:
00018 mm_erf(void)
00019 {
00020 vals = NULL;
00021 }
00022
00023 ~mm_erf(void)
00024 {
00025 if (vals)
00026 delete[] vals;
00027 }
00028
00029 void init(int l, double range, double acc)
00030 {
00031 vals = new double[l];
00032
00033 double y;
00034
00035 for (y=-range+acc/2.0;y<=range+acc;y+=acc)
00036 {
00037 vals[ (int)floor( y/acc ) + ( l / 2 ) ] = erf( y );
00038 }
00039
00040 }
00041
00042 };
00043
00044 };
00045
00046 #endif
00047
00048
00049