Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework
v31r0 (aeb156f0)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
IntegralInTest.cpp
Go to the documentation of this file.
1
// ============================================================================
2
// Include files
3
// ============================================================================
4
// STD & STL
5
// ============================================================================
6
#include <cmath>
7
#include <cstdio>
8
// ============================================================================
9
// GAUDI
10
// ============================================================================
11
#include "
GaudiKernel/SystemOfUnits.h
"
12
#include "
GaudiMath/GaudiMath.h
"
13
// ============================================================================
14
// CLHEP
15
// ============================================================================
16
#include "CLHEP/GenericFunctions/Cos.hh"
17
#include "CLHEP/GenericFunctions/Sin.hh"
18
// ============================================================================
19
// Handle CLHEP 2.0.x move to CLHEP namespace
20
namespace
CLHEP
{}
21
using namespace
CLHEP
;
22
23
// ============================================================================
31
// ============================================================================
32
33
int
main
() {
34
35
std::cout
<<
" Test for numerical differentiation of Genfun::Cos(x) "
<<
std::endl
;
36
37
const
GaudiMath::IndIntegral
& mysin =
GaudiMath::IndIntegral
( Genfun::Cos(), 0, 0.0 );
38
39
for
(
double
x = -90 *
Gaudi::Units::degree
; x <= 180 *
Gaudi::Units::degree
; x += 10 *
Gaudi::Units::degree
) {
40
double
value = mysin( x );
41
double
error = mysin.
error
();
42
printf(
"x=%8.3f deg; I(Cos)=%+.19f; ActErr=%+.19f; EstErr=%+.19f;\n"
, x /
Gaudi::Units::degree
, value,
43
value - sin( x ), error );
44
}
45
}
46
47
// ============================================================================
48
// The END
49
// ============================================================================
Gaudi::Units::degree
constexpr double degree
Definition:
SystemOfUnits.h:107
std::endl
T endl(T...args)
Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral::error
double error() const
evaluate of previous error
Definition:
NumericalIndefiniteIntegral.h:288
main
int main()
Definition:
IntegralInTest.cpp:33
GaudiMath::IndIntegral
Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral IndIntegral
Definition:
GaudiMath.h:28
CLHEP
Definition:
IFuncMinimum.h:16
Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral
The simple class for numerical integrations.
Definition:
NumericalIndefiniteIntegral.h:81
SystemOfUnits.h
std::cout
GaudiMath.h
GaudiGSL
src
Tests
IntegralInTest.cpp
Generated on Mon Feb 11 2019 17:48:13 for The Gaudi Framework by
1.8.11