23 inline double f3(
const double x,
const double y,
const double z)
25 static const double a = 1.0;
26 static const double b = 1.0;
27 static const double c = 1.0;
30 x * (a + x * (b + c*
x)) *
31 y * (a + y * (b + c*y)) *
32 z * (a + z * (b + c*z));
42 int main(
int argc,
char **argv)
54 JParser<> zap(
"Example program to test multi-dimensional interpolation.");
63 catch(
const exception &error) {
64 FATAL(error.what() << endl);
68 const double xmin = -1.0;
69 const double xmax = +1.0;
73 typedef JGridPolint3Function1D_t JFunction1D_t;
75 typedef JMAPLIST<JPolint3FunctionalGridMap,
76 JPolint3FunctionalGridMap>::maplist JMaplist_t;
78 typedef JMultiFunction<JFunction1D_t, JMaplist_t> JMultiFunction_t;
85 for (
double y =
xmin; y <
xmax + 0.5*dx; y += dx) {
86 for (
double z =
xmin; z <
xmax + 0.5*dx; z += dx) {
87 g3[
x][y][z] =
f3(
x,y,z);
94 g3.setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
97 if (numberOfEvents > 0) {
103 for (
int i = 0; i != numberOfEvents; ++i) {
105 const double x = gRandom->Uniform(
xmin,
xmax);
106 const double y = gRandom->Uniform(
xmin,
xmax);
107 const double z = gRandom->Uniform(
xmin,
xmax);
109 const double v =
f3(x,y,z);
113 const double w = g3(x,y,z);
124 timer.print(cout, 1.0 / numberOfEvents,
micro_t);
127 ASSERT(Q.getMean() <= precision);
128 ASSERT(Q.getSTDev() <= precision);
134 cout <<
"> " << flush;
138 if (
getline(cin, buffer) && !buffer.empty()) {
142 istringstream(buffer) >> x >> y >> z;
145 cout <<
f3(x,y,z) <<
' ' << g3(x,y,z) << endl;
147 catch(
const JException& exception) {
148 cout << exception << endl;
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
static const JZero zero
Function object to assign zero value.
Various implementations of functional maps.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
General purpose messaging.
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
Utility class to parse command line options.
double f3(const double x, const double y, const double z)
3D function.
int numberOfBins
number of bins for average CDF integral of optical module