All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Integral1Test.cpp File Reference

Test file for the class NumericalDefiniteIntregral and Integral. More...

#include <math.h>
#include <stdio.h>
#include "GaudiMath/Integral.h"
#include "GaudiMath/GaudiMath.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "CLHEP/GenericFunctions/Sin.hh"
#include "CLHEP/GenericFunctions/Cos.hh"
#include "CLHEP/GenericFunctions/Gaussian.hh"
Include dependency graph for Integral1Test.cpp:

Go to the source code of this file.

Namespaces

namespace  CLHEP
 

Functions

int main ()
 

Detailed Description

Test file for the class NumericalDefiniteIntregral and Integral.

Date
2003-08-31
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru

Definition in file Integral1Test.cpp.

Function Documentation

int main ( )

Definition at line 36 of file Integral1Test.cpp.

{
std::cout <<
" Test for numerical integration of Genfun::Sin(x) " << std::endl ;
const GaudiMath::Function& mysin = Genfun::Sin();
for( double x = 0 * Gaudi::Units::degree ;
x <= 360 * Gaudi::Units::degree ;
x += 15 * Gaudi::Units::degree ) {
double value = GaudiMath::Integral ( mysin , 0. , x ) ;
printf( "x=%8.3f deg; I(Sin)=%+.19f; ActErr=%+.19f;\n",
x / Gaudi::Units::degree , value , value-(1-cos(x)) );
}
const GaudiMath::Function& myfun = Genfun::Gaussian();
std::cout
<< " integral from gauss1 = "
<< std::endl << " integral from gauss2 = "
<< std::endl << " integral from gauss3 = "
<< GaudiMath::Integral( myfun ,
<< std::endl << " integral from gauss4 = "
<< std::endl << " integral from gauss5 = "
<< std::endl << " integral from gauss6 = "
<< std::endl << " integral from gauss7 = "
<< std::endl << " integral from gauss8 = "
<< std::endl ;
exit(0);
}