#include <TMath.h>
#include <TFile.h>
#include <TNtuple.h>
#include "Framework/Messenger/Messenger.h"
#include "Framework/Numerical/BLI2D.h"
#include "Framework/Numerical/RandomGen.h"
Go to the source code of this file.
|
double | func (double x, double y) |
|
int | main (int, char **) |
|
double func |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
int main |
( |
int |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 31 of file gtestBLI2DUnifGrid.cxx.
43 double dx = (xmax-xmin)/(nx-1);
44 double dy = (ymax-ymin)/(ny-1);
48 for(
int ix=0; ix<nx; ix++) {
49 double x = xmin + ix * dx;
50 for(
int iy=0; iy<ny; iy++) {
51 double y = ymin + iy * dy;
59 TNtuple * nt =
new TNtuple(
"nt",
"billinear interpolation validation",
"x:y:ztrue:zeval");
61 for(
int ip=0; ip<npoints; ip++) {
62 double rx = rnd->
RndGen().Uniform();
63 double ry = rnd->
RndGen().Uniform();
64 double x = xmin + (xmax-xmin)*rx;
65 double y = ymin + (ymax-ymin)*ry;
66 double zt =
func(x,y);
67 double ze = biln.Evaluate(x,y);
72 TFile
f(
"./bli2dug.root",
"recreate");
Bilinear interpolation of 2D functions on a regular grid.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double func(double x, double y)
TRandom3 & RndGen(void) const
rnd number generator for generic usage