Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

gslsingleton.cpp 618 B

1234567891011121314151617181920212223242526272829303132
  1. #include "sys.hpp" // for libcwd
  2. #include "debug.hpp" // for libcwd
  3. #include "gslsingleton.h"
  4. #include <time.h>
  5. GslSingleton::GslSingleton()
  6. {
  7. // initialize global random generator
  8. const gsl_rng_type * T;
  9. gsl_rng_env_setup();
  10. T = gsl_rng_default;
  11. gslr = gsl_rng_alloc (T);
  12. #ifdef SEED_RNG_WITH_42
  13. unsigned long int seed = (long)(42);
  14. #else
  15. unsigned long int seed = (long)(time( NULL ));
  16. #endif
  17. gsl_rng_set(gslr, seed);
  18. }
  19. GslSingleton& GslSingleton::GetGslSingleton()
  20. {
  21. static GslSingleton instanz;
  22. return instanz;
  23. }
  24. gsl_rng* GslSingleton::GetGslRng()
  25. {
  26. return gslr;
  27. }