Line | |
---|
1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Tirages aleatoires sur une fonction (thread safe)
|
---|
3 | // C. Magneville 2009
|
---|
4 | // DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay)
|
---|
5 |
|
---|
6 | #ifndef TSFUNRAN_SEEN
|
---|
7 | #define TSFUNRAN_SEEN
|
---|
8 |
|
---|
9 | #include "machdefs.h"
|
---|
10 | #include <stdlib.h>
|
---|
11 | #include <math.h>
|
---|
12 | #include "histos.h"
|
---|
13 | #include "tvector.h"
|
---|
14 | #include "stsrand.h"
|
---|
15 | #include "classfunc.h"
|
---|
16 |
|
---|
17 | namespace SOPHYA {
|
---|
18 |
|
---|
19 | class TsFunRan : public Histo {
|
---|
20 | public:
|
---|
21 | typedef r_8 (*Func)(r_8);
|
---|
22 | TsFunRan(ClassFunc& f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100, bool pdf=true);
|
---|
23 | TsFunRan(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100, bool pdf=true);
|
---|
24 | TsFunRan(r_8 *tab, int_4 nBin, bool pdf=true);
|
---|
25 | TsFunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf=true);
|
---|
26 | TsFunRan(TVector<r_8>& tab, int_4 nBin, bool pdf=true);
|
---|
27 | TsFunRan(TVector<r_8>& tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf=true);
|
---|
28 | TsFunRan(Histo &h, bool pdf=true);
|
---|
29 | TsFunRan(const TsFunRan& fh);
|
---|
30 | TsFunRan(void);
|
---|
31 | virtual ~TsFunRan(void);
|
---|
32 |
|
---|
33 | void SetRandomGenerator(RandomGenerator& rg);
|
---|
34 |
|
---|
35 | int_4 BinRandom(void);
|
---|
36 | r_8 Random(void);
|
---|
37 | r_8 RandomInterp(void);
|
---|
38 | protected:
|
---|
39 | void create_DF(bool pdf);
|
---|
40 | RandomGenerator* rg_;
|
---|
41 | };
|
---|
42 |
|
---|
43 | } // namespace SOPHYA
|
---|
44 |
|
---|
45 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.