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

Last change on this file since 2838 was 2838, checked in by cmv, 20 years ago

add FurRan constructor from Histo cmv 09/11/2005

File size: 1.1 KB
RevLine 
[220]1// This may look like C code, but it is really -*- C++ -*-
2// Nombres aleatoires pour Peida.
[1371]3// C. Magneville 1996-2000
4// DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay)
[220]5
6#ifndef PERANDOM_SEEN
7#define PERANDOM_SEEN
8
[244]9#include "machdefs.h"
[220]10#include <stdlib.h>
11#include "histos.h"
12#include "nbrandom.h"
13
[1371]14namespace SOPHYA {
15
[220]16class FunRan : public Histo {
17public:
[1092]18 typedef r_8 (*Func)(r_8);
19 FunRan(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100);
20 FunRan(r_8 *tab, int_4 nBin);
21 FunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax);
[2838]22 FunRan(Histo &h);
[1092]23 void IFunRan(r_8 *tab, int_4 nBin);
24 r_8 Random(void);
25 int_4 BinRandom(void);
[220]26};
27
[1371]28class FunRan2D {
[220]29public:
[1092]30// typedef r_8 (*Func)(r_8, r_8);
31// FunRan2D(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBinX=100,
32// r_8 yMin=0.0, r_8 yMax=1.0, int_4 nBinY=100);
33 FunRan2D(r_8 *tab, int_4 nBinX, int_4 nBinY);
34 FunRan2D(r_8 **tab, int_4 nBinX, int_4 nBinY);
[220]35 ~FunRan2D();
[1092]36 void Random(r_8& x, r_8& y);
37 void BinRandom(int_4& x, int_4& y);
[220]38private:
39 FunRan* ranX;
40 FunRan** ranY;
[1092]41 int_4 nx;
[220]42};
43
[1371]44} // namespace SOPHYA
45
[220]46#endif
Note: See TracBrowser for help on using the repository browser.