| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Namespaces | Functions
DerivativeTest.cpp File Reference

Test file for the class NumericalDerivative. More...

`#include <math.h>`
`#include <stdio.h>`
`#include <iostream>`
`#include "GaudiMath/GaudiMath.h"`
`#include "GaudiKernel/SystemOfUnits.h"`
`#include "CLHEP/GenericFunctions/Sin.hh"`
Include dependency graph for DerivativeTest.cpp:

Go to the source code of this file.

## Namespaces
| CLHEP

## Functions
int | main ()

## Detailed Description

Test file for the class NumericalDerivative.

Date
  2003-08-31

Author
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru

Definition in file DerivativeTest.cpp.

## Function Documentation

int main | ( |  | ) |

Definition at line 33 of file DerivativeTest.cpp.

34 {
35
36 std::cout <<
37 " Test for numerical differentiation of Genfun::Sin(x) " << std::endl ;
38
39 const GaudiMath::Function& mysin = Genfun::Sin();
40 const GaudiMath::Derivative& prim1 = GaudiMath::Derivative( mysin , 0 );
41 const GaudiMath::Function& prim = prim1 ;
42
43 for( double x = -90 * Gaudi::Units::degree ;
44 x <= 180 * Gaudi::Units::degree ;
45 x += 10 * Gaudi::Units::degree ) {
46 double value = prim(x) ;
47 double error = prim1.error() ;
48 printf
49 ( " x=%8.3f deg; Sin'=%+.19f; ActualErr=%+.19f; EstimatedErr=%+.19f\n",
50 x / Gaudi::Units::degree ,
51 value ,
52 value - cos(x) ,
53 error );
54 }
55
56 exit(0);
57
58 }
Gaudi::Units::degree
constexpr double degree
Definition: SystemOfUnits.h:108
Genfun::GaudiMathImplementation::NumericalDerivative::error
double error() const
the absolute error estimate for the last call
Definition: NumericalDerivative.h:132
std::endl
T endl(T...args)
GaudiMath::Function
Genfun::AbsFunction Function
Definition: GaudiMath.h:24
GaudiMath::Derivative
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:29
std::exit
T exit(T...args)
std::cos
T cos(T...args)
Genfun::GaudiMathImplementation::NumericalDerivative
Numerical derivative (using GSL adaptive numerical differentiation)
Definition: NumericalDerivative.h:42
std::printf
T printf(T...args)
std::cout