3DoubleFuncTest.cpp File Reference

Test file for the class Adapter3DoubleFunction. More...

#include <math.h>
#include <stdio.h>
#include "GaudiMath/GaudiMath.h"
#include "GaudiMath/Adapters.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 30 of file 3DoubleFuncTest.cpp.

31 {
33  Genfun::Argument arg(3);
34 
35  std::string format( "x=%6.5f y=%6.5f z=%6.5f mysum=%+.10f");
36  format +=" sum=%+.10f sum-mysum=%+.10f \n" ;
37 
38  for ( double x = 0; x < 3; ++x)
39  {
40  for (double y = 0; y < 3; ++y)
41  {
42  for (double z = 0; z < 3; ++z)
43  {
44  arg[0] = x;
45  arg[1] = y;
46  arg[2] = z;
47  printf ( format.c_str() ,
48  x, y, z, mysum(arg), sum(x, y, z),
49  sum(x, y, z) - mysum(arg) );
50  }
51  }
52  }
53 
54  exit(0);
55 
56 }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
double sum(double x, double y, double z)
Genfun::AbsFunction Function
Definition: GaudiMath.h:24
STL class.
T exit(T...args)
GAUDI_API AIDAFunction adapter(const AIDA::IFunction &function)
Definition: Adapters.cpp:27
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.

26 {
27  return 3 * x * x - 5 * y * y + 3 * z * z;
28 }