11 /*----------------------------------------------------------------------*\
13 \*---------------------------------------------------------------------*/
15 /*--------------------------------------*\
17 \*-------------------------------------*/
19 AleaTools::AleaTools()
24 AleaTools::~AleaTools()
29 /*--------------------------------------*\
31 \*-------------------------------------*/
33 /*----------------------*\
35 \*---------------------*/
39 * Attention : pas thread safe
41 double AleaTools::uniformeAB(double a
, double b
)
43 return a
+ uniforme01() * (b
- a
);
48 * Attention : pas thread safe
50 double AleaTools::uniforme01(void)
52 // rand in [0,RAND_MAX]
53 return rand() / (double) RAND_MAX
;
58 * Attention : pas thread safe
60 int AleaTools::uniformeAB(int a
, int b
)
62 // rand in [0,RAND_MAX]
63 double pente
= (b
-a
)/(double)RAND_MAX
;
65 return a
+(int)(pente
*rand());
69 /*----------------------------------------------------------------------*\
71 \*---------------------------------------------------------------------*/