All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
3DoubleFuncTest.cpp
Go to the documentation of this file.
1 // $Id: 3DoubleFuncTest.cpp,v 1.3 2005/11/25 10:27:03 mato Exp $
2 // ============================================================================
3 // Include files
4 // ============================================================================
5 // STD & STL
6 // ============================================================================
7 #include <math.h>
8 #include <stdio.h>
9 // ============================================================================
10 // GaudiMath
11 // ============================================================================
12 #include "GaudiMath/GaudiMath.h"
13 #include "GaudiMath/Adapters.h"
14 // ============================================================================
15 
16 // ============================================================================
24 // ============================================================================
25 
26 double sum ( double x, double y, double z )
27 {
28  return 3 * x * x - 5 * y * y + 3 * z * z;
29 }
30 
31 int main()
32 {
34  Genfun::Argument arg(3);
35 
36  std::string format( "x=%6.5f y=%6.5f z=%6.5f mysum=%+.10f");
37  format +=" sum=%+.10f sum-mysum=%+.10f \n" ;
38 
39  for ( double x = 0; x < 3; ++x)
40  {
41  for (double y = 0; y < 3; ++y)
42  {
43  for (double z = 0; z < 3; ++z)
44  {
45  arg[0] = x;
46  arg[1] = y;
47  arg[2] = z;
48  printf ( format.c_str() ,
49  x, y, z, mysum(arg), sum(x, y, z),
50  sum(x, y, z) - mysum(arg) );
51  }
52  }
53  }
54 
55  exit(0);
56 
57 }
58 
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:133
double sum(double x, double y, double z)
Genfun::AbsFunction Function
Definition: GaudiMath.h:26
int main()
GAUDI_API AIDAFunction adapter(const AIDA::IFunction &function)
Definition: Adapters.cpp:28