Test file for the class AdapterPFunction.
More...
#include <math.h>
#include <stdio.h>
#include <vector>
#include "GaudiMath/GaudiMath.h"
#include "GaudiMath/Adapters.h"
Go to the source code of this file.
|
double | fun (const std::vector< double > &x) |
|
int | main () |
|
Test file for the class AdapterPFunction.
- Date
- 2003-09-03
- Author
- Kirill Miklyaev kiril.nosp@m.lm@i.nosp@m.ris1..nosp@m.itep.nosp@m..ru
Definition in file PFuncTest.cpp.
double fun |
( |
const std::vector< double > & |
x | ) |
|
Definition at line 27 of file PFuncTest.cpp.
29 return 3 * x[0] * x[0] + 5 * x[1] * x[1] + 8;
Definition at line 32 of file PFuncTest.cpp.
35 Genfun::Argument arg(myfun.dimensionality());
37 std::string
format(
"x[0]=%6.5f x[1]=%6.5f myfun=%+.10f");
38 format +=
" fun=%+.10f fun-myfun=%+.10f \n" ;
39 std::vector<double> x =
40 std::vector<double>(myfun.dimensionality());
42 for (
double a = 0; a < 3; ++a)
44 for (
double b = 0; b < 3; ++b)
50 x[0], x[1], myfun(arg),
fun(x),
51 fun(x) - myfun(arg) );
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Genfun::AbsFunction Function
GAUDI_API AIDAFunction adapter(const AIDA::IFunction &function)
double fun(const std::vector< double > &x)