34 inline double f2(
const double x,
37 const double u = 1.0e2 / (
x*
x);
39 return exp(-0.5*(y*y)/(u*u));
50int main(
int argc,
char **argv)
60 JParser<> zap(
"Example program to test JTab1D & interpolation between 1D tables.");
67 catch(
const exception &error) {
68 FATAL(error.what() << endl);
85 for (
int i = 0; i != X.
getSize(); ++i) {
87 DEBUG(
"table[" << i <<
"]" << endl);
89 const double x = X.
getX(i);
91 JTable1D_t& table = buffer[x];
93 for (
int __i = 0; __i != NY; ++__i) {
95 const double y = Y.
getX(__i);
99 DEBUG(
' ' <<
FIXED(5,3) << table[__i] << endl);
107 tab1[0] = 1; tab1[1] = 2; tab1[2] = 3;
109 tab2[0] = 4; tab2[1] = 5; tab2[2] = 6;
112 ASSERT(tab2[1] == 5,
"GetEntry");
114 ASSERT((tab2.
add(tab1))[0] == -3,
"Add");
115 ASSERT((tab2.
sub(tab1))[0] == -4,
"Subtract");
116 ASSERT(tab1.
mul(5)[1] == 10,
"Multiply");
131 for (
int i = 0; i != numberOfEvents; ++i) {
136 const double v = f2(x,y);
145 const double w1 = buffer(x)[__i];
154 const JTable1D_t& table = buffer(x);
156 for (
int __i = 0; __i != Y.
getSize(); ++__i) {
157 g2.getY(__i) = table[__i];
163 const double w2 = g2(y);
173 cout << i->getTitle() << endl;
174 cout <<
"mean " <<
SCIENTIFIC(10,2) << i->getMean() << endl;
175 cout <<
"RMS " <<
SCIENTIFIC(10,2) << i->getSTDev() << endl;
179 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
I/O formatting auxiliaries.
int main(int argc, char **argv)
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.
Auxiliary data structure for floating point format specification.