| 1606 | |
| 1607 | #ifdef HAVE_GSL |
| 1608 | gsl_rng *gsl_init() |
| 1609 | { |
| 1610 | static gsl_rng *rng = nullptr; |
| 1611 | |
| 1612 | if (rng) { |
| 1613 | return rng; |
| 1614 | } |
| 1615 | |
| 1616 | gsl_rng_env_setup(); |
| 1617 | rng = gsl_rng_alloc(gsl_rng_default); |
| 1618 | if (!rng) { |
| 1619 | ERROR("Could not initialize GSL random number generator"); |
| 1620 | } |
| 1621 | |
| 1622 | return rng; |
| 1623 | } |
| 1624 | |
| 1625 | /* Normal distribution. */ |
| 1626 | CNormal::CNormal(double mean, double stdev) |