20 |
#include <config.h> |
#include <config.h> |
21 |
#include "settings.h" |
#include "settings.h" |
22 |
#include <assert.h> |
#include <assert.h> |
23 |
|
#include <stdlib.h> |
24 |
#include <time.h> |
#include <time.h> |
25 |
#include "format.h" |
#include "format.h" |
26 |
#include "val.h" |
#include "val.h" |
78 |
CC_INITIALIZER, |
CC_INITIALIZER, |
79 |
}; |
}; |
80 |
|
|
|
static gsl_rng *rng; |
|
|
|
|
81 |
static bool testing_mode = false; |
static bool testing_mode = false; |
82 |
|
|
83 |
static int global_algorithm = ENHANCED; |
static int global_algorithm = ENHANCED; |
91 |
void |
void |
92 |
done_settings (void) |
done_settings (void) |
93 |
{ |
{ |
|
if (rng != NULL) |
|
|
gsl_rng_free (rng); |
|
|
|
|
94 |
free (prompt); |
free (prompt); |
95 |
free (cprompt); |
free (cprompt); |
96 |
free (dprompt); |
free (dprompt); |
490 |
/* Approximate maximum amount of memory to use for cases, in |
/* Approximate maximum amount of memory to use for cases, in |
491 |
bytes. */ |
bytes. */ |
492 |
size_t |
size_t |
493 |
get_workspace(void) |
get_workspace (void) |
494 |
{ |
{ |
495 |
return workspace; |
return workspace; |
496 |
} |
} |
536 |
cc[idx] = *cc_; |
cc[idx] = *cc_; |
537 |
} |
} |
538 |
|
|
|
/* Returns the current random number generator. */ |
|
|
gsl_rng * |
|
|
get_rng (void) |
|
|
{ |
|
|
if (rng == NULL) |
|
|
set_rng (time (0)); |
|
|
return rng; |
|
|
} |
|
|
|
|
|
/* Initializes or reinitializes the random number generator with |
|
|
the given SEED. */ |
|
|
void |
|
|
set_rng (unsigned long seed) |
|
|
{ |
|
|
rng = gsl_rng_alloc (gsl_rng_mt19937); |
|
|
if (rng == NULL) |
|
|
xalloc_die (); |
|
|
gsl_rng_set (rng, seed); |
|
|
} |
|
|
|
|
539 |
/* Are we in testing mode? (e.g. --testing-mode command line |
/* Are we in testing mode? (e.g. --testing-mode command line |
540 |
option) */ |
option) */ |
541 |
bool |
bool |