46   const double xmax = +1.0e10;  
 
   51   inline double f1(
const double x)
 
   59   inline double F1(
const double x)
 
   63     return -0.5 * exp(-
x) * (
x*sin(
x) + (
x + 1.0)*cos(
x));
 
   74   const double sigma[] = { 4.0, 0.5 };
 
   97 int main(
int argc, 
char **argv)
 
  107     JParser<> zap(
"Example program to test JTOOLS::JQuadrature.");
 
  114   catch(
const exception &error) {
 
  115     FATAL(error.what() << endl);
 
  125     const double x0 = 0.5 * (
xmax + 
xmin);
 
  126     const double x1 = 0.5 * (
xmax - 
xmin);
 
  132       const double x = x0 + i->getX() * x1;
 
  134       W += 
f1(
x) * i->getY() * x1;
 
  137     DEBUG(
"integral analytical " << 
FIXED(9,5) << V << endl);
 
  138     DEBUG(
"integral numerical  " << 
FIXED(9,5) << W << endl);
 
  140     ASSERT(fabs(V - W) <= precision, 
"Test Gauss-Legendre integration.");
 
  153       const double x = i->getX();
 
  155       W += 
f1(
x) * i->getY();
 
  158     DEBUG(
"integral analytical " << 
FIXED(9,5) << V << endl);
 
  159     DEBUG(
"integral numerical  " << 
FIXED(9,5) << W << endl);
 
  161     ASSERT(fabs(V - W) <= precision, 
"Test Gauss-Laguerre integration.");
 
  170       const double V = 
F1(
x);
 
  176         const double u = i->getX() * 
sigma[1] * sqrt(2.0);
 
  177         const double v = i->getY() / sqrt(
PI);
 
  184       ASSERT(fabs(V - W) <= precision * V, 
"Test Gauss-Hermite integration.");
 
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)
 
Auxiliary classes for numerical integration.
 
Utility class to parse command line options.
 
const JPolynome F1
Integral.
 
const JPolynome f1(1.0, 2.0, 3.0)
Function.
 
static const double PI
Mathematical constants.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Auxiliary data structure for floating point format specification.
 
Recursive template class for polynomial function.
 
double getIntegral(const double x) const
Integral value.