IAP GITLAB

Skip to content
Snippets Groups Projects
Commit b0e99bbc authored by Felix Riehn's avatar Felix Riehn Committed by ralfulrich
Browse files

double random

parent 761248fd
No related branches found
No related tags found
1 merge request!318Resolve "EPOS is missing"
......@@ -28,4 +28,11 @@ namespace epos {
return dist(rng);
}
double double_rndm_interface() {
static corsika::default_prng_type& rng =
corsika::RNGManager::getInstance().getRandomStream("epos");
std::uniform_real_distribution<double> dist;
return dist(rng);
}
} // namespace epos
......@@ -9,7 +9,8 @@ namespace epos {
// this is needed as linker object, but it is not needed to do anything
void ranfcv_(double&) {}
float rangen_() { return ::epos::rndm_interface(); }
float rangen_() { return ::epos::rndm_interface(); }
double drangen_() { return ::epos::double_rndm_interface(); }
datadir::datadir(const std::string& dir) {
if (dir.length() > 500) {
......
......@@ -27,6 +27,16 @@ namespace epos {
**/
extern float rndm_interface();
/**
* \function epos::double_rndm_interface
*
* this is the random number hook to external packages.
*
* CORSIKA8, for example, has to provide an implementation of this.
**/
extern double double_rndm_interface();
extern "C" {
void aaset_(int&);
......@@ -76,6 +86,7 @@ namespace epos {
void ranfcv_(double&);
// void ranfgt(int&);
float rangen_();
double drangen_();
// common blocks as
// defined in epos.inc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment