CGStandardDeviationUnitTest.cpp File Reference

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
34 {
35  logger(INFO," Checking setting the standard deviation of cg functions");
36 
37  {
39  X.setStandardDeviation(1);
40  helpers::check(X.getFunction().getCutoff(),constants::sqrt_3,1e-11, "Cutoff of 1D Heaviside with unit variance");
41 
43  XY.setStandardDeviation(1);
44  helpers::check(XY.getFunction().getCutoff(),constants::sqrt_2,1e-11, "Cutoff of 2D Heaviside with unit variance");
45 
47  XYZ.setStandardDeviation(1);
48  helpers::check(XYZ.getFunction().getCutoff(),sqrt(5./3.),1e-11, "Cutoff of 3D Heaviside with unit variance");
49  }
50 
51  {
53  X.setStandardDeviation(1);
54  helpers::check(X.getFunction().getCutoff(),sqrt(10.5),1e-11, "Cutoff of 1D Lucy with unit variance");
55 
57  XY.setStandardDeviation(1);
58  helpers::check(XY.getFunction().getCutoff(),sqrt(5.6),1e-11, "Cutoff of 2D Lucy with unit variance");
59 
61  XYZ.setStandardDeviation(1);
62  helpers::check(XYZ.getFunction().getCutoff(),2,1e-11, "Cutoff of 3D Lucy with unit variance");
63  }
64 
65  {
67  X.setStandardDeviation(1);
68  helpers::check(X.getFunction().getCutoff(),3,1e-11, "Cutoff of 1D Gauss with unit variance");
69 
71  XY.setStandardDeviation(1);
72  helpers::check(XY.getFunction().getCutoff(),3/sqrt(2),1e-11, "Cutoff of 2D Gauss with unit variance");
73 
75  XYZ.setStandardDeviation(1);
76  helpers::check(XYZ.getFunction().getCutoff(),3/sqrt(3),1e-11, "Cutoff of 3D Gauss with unit variance");
77  }
78 
79 
80 
81  {
83  X.setRadius(1);
84  helpers::check(X.getFunction().getCutoff(),constants::sqrt_3*sqrt(.2),1e-11, "Cutoff of 1D Heaviside with unit radius-equivalent");
85 
87  XY.setRadius(1);
88  helpers::check(XY.getFunction().getCutoff(),constants::sqrt_2*sqrt(.4),1e-11, "Cutoff of 2D Heaviside with unit radius-equivalent");
89 
91  XYZ.setRadius(1);
92  helpers::check(XYZ.getFunction().getCutoff(),sqrt(5./3.)*sqrt(.6),1e-11, "Cutoff of 3D Heaviside with unit radius-equivalent");
93  }
94 
95  {
97  X.setRadius(1);
98  helpers::check(X.getFunction().getCutoff(),sqrt(6)*sqrt(.2),1e-11, "Cutoff of 1D Linear with unit radius-equivalent");
99 
101  XY.setRadius(1);
102  helpers::check(XY.getFunction().getCutoff(),sqrt(10./3)*sqrt(.4),1e-11, "Cutoff of 2D Linear with unit radius-equivalent");
103 
105  XYZ.setRadius(1);
106  helpers::check(XYZ.getFunction().getCutoff(),sqrt(5./2)*sqrt(.6),1e-11, "Cutoff of 3D Linear with unit radius-equivalent");
107  }
108 
109  {
111  X.setRadius(1);
112  helpers::check(X.getFunction().getCutoff(),sqrt(10.5)*sqrt(.2),1e-11, "Cutoff of 1D Lucy with unit radius-equivalent");
113 
115  XY.setRadius(1);
116  helpers::check(XY.getFunction().getCutoff(),sqrt(5.6)*sqrt(.4),1e-11, "Cutoff of 2D Lucy with unit radius-equivalent");
117 
119  XYZ.setRadius(1);
120  helpers::check(XYZ.getFunction().getCutoff(),2*sqrt(.6),1e-11, "Cutoff of 3D Lucy with unit radius-equivalent");
121  }
122 
123  {
125  X.setRadius(1);
126  helpers::check(X.getFunction().getCutoff(),3*sqrt(.2),1e-11, "Cutoff of 1D Gauss with unit radius-equivalent");
127 
129  XY.setRadius(1);
130  helpers::check(XY.getFunction().getCutoff(),3/sqrt(2)*sqrt(.4),1e-11, "Cutoff of 2D Gauss with unit radius-equivalent");
131 
133  XYZ.setRadius(1);
134  helpers::check(XYZ.getFunction().getCutoff(),3/sqrt(3)*sqrt(.6),1e-11, "Cutoff of 3D Gauss with unit radius-equivalent");
135  }
136  return 0;
137 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ XY
Definition: StatisticsVector.h:42
@ X
Definition: StatisticsVector.h:42
@ XYZ
Definition: StatisticsVector.h:42
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:76
const Mdouble sqrt_3
Definition: ExtendedMath.h:49
const Mdouble sqrt_2
Definition: ExtendedMath.h:48
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References helpers::check(), INFO, logger, constants::sqrt_2, constants::sqrt_3, X, XY, and XYZ.