List of all members.
Detailed Description
Definition at line 25 of file random.
Constructor & Destructor Documentation
inlib::random::gauss::gauss |
( |
double |
a_mean = 0 , |
|
|
double |
a_std_dev = 1 |
|
) |
| [inline] |
Definition at line 27 of file random.
:m_mean(a_mean),m_std_dev(a_std_dev){}
inlib::random::gauss::gauss |
( |
const gauss & |
a_from | ) |
[inline] |
Definition at line 30 of file random.
:m_mean(a_from.m_mean),m_std_dev(a_from.m_std_dev){}
Member Function Documentation
gauss& inlib::random::gauss::operator= |
( |
const gauss & |
a_from | ) |
[inline] |
Definition at line 32 of file random.
{
m_mean = a_from.m_mean;
m_std_dev = a_from.m_std_dev;
return *this;
}
double inlib::random::gauss::shoot |
( |
| ) |
const [inline] |
Definition at line 38 of file random.
{
double v1,v2,r,fac;
do {
v1 = 2.0 * m_flat.shoot() - 1.0;
v2 = 2.0 * m_flat.shoot() - 1.0;
r = v1*v1 + v2*v2;
} while ( r > 1.0 );
fac = ::sqrt(-2.0*::log(r)/r);
return (v2 * fac) * m_std_dev + m_mean;
}
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/old/inexlib-1.2/inlib/inlib/random