template<class FLAT, class REAL, class UINT>
class tools::rbinomial< FLAT, REAL, UINT >
Definition at line 196 of file randT.
template<class FLAT , class REAL , class UINT >
Generates a random integer N according to the binomial law. Coded from Los Alamos report LA-5061-MS.
N is binomially distributed between 0 and ntot inclusive with mean prob*ntot and prob is between 0 and 1.
Note: This function should not be used when ntot is large (say >100). The normal approximation is then recommended instead (with mean =*ntot+0.5 and standard deviation sqrt(ntot*prob*(1-prob)).
Definition at line 208 of file randT.
221 if((
m_p<REAL(0))||(REAL(1)<
m_p))
return 0;
223 for(UINT i=0;i<
m_n;i++) {