source: Sophya/trunk/SophyaLib/NTools/perandom.h@ 220

Last change on this file since 220 was 220, checked in by ansari, 26 years ago

Creation module DPC/NTools Reza 09/04/99

File size: 1017 bytes
Line 
1// This may look like C code, but it is really -*- C++ -*-
2
3// Nombres aleatoires pour Peida.
4
5#ifndef PERANDOM_SEEN
6#define PERANDOM_SEEN
7
8#include <stdlib.h>
9#include "defs.h"
10#include "machine.h"
11#include "histos.h"
12#include "nbrandom.h"
13
14class FunRan : public Histo {
15public:
16 typedef double (*Func)(double);
17 FunRan(Func f, float xMin=0.0, float xMax=1.0, int nBin=100);
18 FunRan(double *tab, int nBin);
19 FunRan(double *tab, int nBin, float xMin, float xMax);
20 void IFunRan(double *tab, int nBin);
21 double Random(void);
22 int BinRandom(void);
23};
24
25class FunRan2D EXC_AWARE {
26public:
27// typedef double (*Func)(double, double);
28// FunRan2D(Func f, float xMin=0.0, float xMax=1.0, int nBinX=100,
29// float yMin=0.0, float yMax=1.0, int nBinY=100);
30 FunRan2D(double *tab, int nBinX, int nBinY);
31 FunRan2D(double **tab, int nBinX, int nBinY);
32 ~FunRan2D();
33 void Random(double& x, double& y);
34 void BinRandom(int& x, int& y);
35private:
36 FunRan* ranX;
37 FunRan** ranY;
38 int nx;
39};
40
41#endif
Note: See TracBrowser for help on using the repository browser.