Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
3DoubleFuncTest.cpp File Reference

Test file for the class Adapter3DoubleFunction. More...

#include <cmath>
#include <cstdio>
#include "GaudiMath/Adapters.h"
#include "GaudiMath/GaudiMath.h"
Include dependency graph for 3DoubleFuncTest.cpp:

Go to the source code of this file.

Functions

double sum (double x, double y, double z)
 
int main ()
 

Detailed Description

Test file for the class Adapter3DoubleFunction.

Date
2003-09-03
Author
Kirill Miklyaev kiril.nosp@m.lm@i.nosp@m.ris1..nosp@m.itep.nosp@m..ru

Definition in file 3DoubleFuncTest.cpp.

Function Documentation

int main ( )

Definition at line 27 of file 3DoubleFuncTest.cpp.

27  {
28  const GaudiMath::Function& mysum = GaudiMath::adapter( sum );
29  Genfun::Argument arg( 3 );
30 
31  std::string format( "x=%6.5f y=%6.5f z=%6.5f mysum=%+.10f" );
32  format += " sum=%+.10f sum-mysum=%+.10f \n";
33 
34  for ( double x = 0; x < 3; ++x ) {
35  for ( double y = 0; y < 3; ++y ) {
36  for ( double z = 0; z < 3; ++z ) {
37  arg[0] = x;
38  arg[1] = y;
39  arg[2] = z;
40  printf( format.c_str(), x, y, z, mysum( arg ), sum( x, y, z ), sum( x, y, z ) - mysum( arg ) );
41  }
42  }
43  }
44 
45  exit( 0 );
46 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
double sum(double x, double y, double z)
Genfun::AbsFunction Function
Definition: GaudiMath.h:23
STL class.
T exit(T...args)
GAUDI_API AIDAFunction adapter(const AIDA::IFunction &function)
Definition: Adapters.cpp:24
T c_str(T...args)
T printf(T...args)
double sum ( double  x,
double  y,
double  z 
)

Definition at line 25 of file 3DoubleFuncTest.cpp.

25 { return 3 * x * x - 5 * y * y + 3 * z * z; }