36 inline double f3(
const double x,
40 return sin(z/2)*exp(-fabs(z)) * (
x*
x -
x*
y -
y*
y +
x -2*
y + 3) / 25;
51int main(
int argc,
char **argv)
62 JParser<> zap(
"Example program to test interpolation between 1D tables on 2D grid.");
70 catch(
const exception &error) {
71 FATAL(error.what() << endl);
93 for (
int ix = 0; ix != X.
getSize(); ++ix) {
94 for (
int iy = 0; iy != Y.
getSize(); ++iy) {
96 DEBUG(
"table[" << ix <<
", " << iy <<
"]" << endl);
98 const double x = X.
getX(ix);
99 const double y = Y.
getX(iy);
101 JTable1D_t& table = g3[x][y];
103 for (
int iz = 0; iz != Z.
getSize(); ++iz) {
105 const double z = Z.
getX(iz);
106 table[iz] =
f3(x,y,z);
118 JTimer t1(
"JTable1D interpolant");
120 for (
int i = 0; i != numberOfEvents; ++i) {
124 DEBUG(
"x = " << x <<
" y = " << y << endl);
127 JTable1D_t res = g3(x,y);
134 for (
int iz = 0; iz != Z.
getSize(); ++iz) {
135 const double z = Z.
getX(iz);
136 double val_f3 =
f3(x,y,z);
139 if (fabs((val_f3 - res[iz]) / res[iz]) > precision) {valid = 0;}
148 i->print(cout,
true, micro_t);
The elements in a collection are sorted according to their abscissa values and a given distance opera...
Various implementations of functional maps.
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
double f3(const double x, const double y, const double z)
3D function.
I/O formatting auxiliaries.
Auxiliary class for CPU timing and usage.
const std::string & getTitle() const
Get title.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.