![]() |
Prev | Next |
# include <cppad/mixed/manage_gsl_rng.hpp>
s_out = CppAD::mixed::new_gsl_rng(s_in)
rng = CppAD::mixed::get_gsl_rng()
CppAD::mixed::free_gsl_rng()
free_gsl_rng
before new_gsl_rng
can be called again.
size_t s_in
If
s_in != 0
,
it is used as a seed for the random number generator.
Otherwise the actual seed is the number of seconds returned by
std::time
plus the number of previous calls to set_gsl_rng
.
(Adding the number of calls prevents the same
seed from being used by calls that are close together in time.)
size_t s_out
and is the actual seed that was used to initialize the random number generator.
new_gsl_rng
and free_gsl_rng
,
this routine retrieves a pointer to the current
GSL random number generator.
Otherwise it returns the null pointer.
rng
has prototype
gsl_rng* rng
new_gsl_rng
,
you should free the corresponding memory using
gsl_rng_free()
.
manage_gsl_rng
. It returns true
, if the test passes,
and false
otherwise.