78{
81
83
84 unsigned int numberOfEvents;
87 map_type precision;
89
90 precision["spline"] = JPrecision_t(1.0e-3, 1.0e-1, 1.0e-4);
91 precision["hermite"] = JPrecision_t(1.0e-3, 1.0e-1, 1.0e-4);
92 precision["grid"] = JPrecision_t(1.0e-3, 1.0e-1, 1.0e-4);
93 precision["polint"] = JPrecision_t(1.0e-14, 1.0e-12, 1.0e-14);
94
95 try {
96
97 JParser<> zap(
"Example program to test 1D interpolation of a polynome.");
98
104
106 }
107 catch(const exception &error) {
109 }
110
111
112 const int N = 3;
113
119
120 const double xmin = -1.0;
121 const double xmax = +1.0;
122
127
132
134
136
137 if (numberOfEvents != 0) {
138
143
144 for (unsigned int i = 0; i != numberOfEvents; ++i) {
145
146 const double x =
gRandom->Uniform(xmin, xmax);
147
151
156
161
166 }
167
168 if (
debug >= debug_t) {
169
171 cout <<
"_________________________________________" <<
endl;
172
177
182
187
192 }
193
197
201
202 ASSERT(
Qgrid .f .getSTDev() <= precision[
"grid"].f);
203 ASSERT(
Qgrid .fp.getSTDev() <= precision[
"grid"].fp);
204 ASSERT(
Qgrid .v .getSTDev() <= precision[
"grid"].v);
205
209
210 } else {
211
212 for ( ; ; ) {
213
214 string buffer;
215
216 cout <<
"> " << flush;
217
219
220 if (buffer != "") {
221
222 try {
223
225
227
233 }
236 }
237
238 } else {
239 break;
240 }
241 }
242 }
243
244 return 0;
245}
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int numberOfBins
number of bins for average CDF integral of optical module
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Recursive template class for polynomial function.
double getIntegral(const double x) const
Integral value.
double getValue(const double x) const
Function value.
double getDerivative(const double x) const
Derivative value.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.